Skip to content

[DM] Support range read and lock optimization#140

Merged
flowbehappy merged 12 commits intoDeltaMergeEnginefrom
dm-optimization
Aug 5, 2019
Merged

[DM] Support range read and lock optimization#140
flowbehappy merged 12 commits intoDeltaMergeEnginefrom
dm-optimization

Conversation

@flowbehappy
Copy link
Contributor

  • Support multiple ranges read.
    Note that there could be performance issues and bugs for this feature. So we currently by default disable this feature and will come back to it when implementing sparse index.
  • Remove the huge lock of DeltaMergeStore, so that we can do read and write concurrently.
  • Optimize DMVersionFilterBlockInputStream, unroll filter loop and improve performance.

@flowbehappy flowbehappy requested a review from JaySon-Huang July 25, 2019 07:44
@flowbehappy flowbehappy changed the title Support range read and lock optimization [DM] Support range read and lock optimization Jul 25, 2019
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we return at least one stream? If sorted_ranges is [(+∞, +∞)] (line 227), then we will return 0 stream

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so, tasks.size() should be 1.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But here it will end with tasks.size() == 0 if we pass [(Int64::max, Int64::max)]. (Int64::max, Int64::max) intersect (Int64::min, Int64::max) return false in https://github.com/pingcap/tics/pull/140/files#diff-cc98b6f41bd336729fc39462f72a29d3R287

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If user use UInt64 as pk, and pass range between [Int64::MAX~UInt64::MAX] ?

Copy link
Contributor Author

@flowbehappy flowbehappy Aug 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need to considerate this situation. But later https://internal.pingcap.net/jira/browse/FLASH-392

@flowbehappy
Copy link
Contributor Author

/run-integration-tests

@flowbehappy
Copy link
Contributor Author

/build

@flowbehappy
Copy link
Contributor Author

/run-integration-tests

@flowbehappy flowbehappy merged commit 963f14b into DeltaMergeEngine Aug 5, 2019
@flowbehappy flowbehappy deleted the dm-optimization branch August 5, 2019 09:15
JaySon-Huang pushed a commit to JaySon-Huang/tiflash that referenced this pull request Aug 26, 2019
* Segment support range scan

* Bug fix: ColumnVector insertRangeFrom out of range

* Only read tag column when necessary

* print more info on sidLowerBound exception

* Refactor DeltaMergeBlockInputStream

* Optimize DMVersionFilterBlockInputStream, try unroll loops.

* Support multi range read

* bug fix

* Optimize synchronization mechanism between read/write thread, decrease latency.

* Fix testes

* Address comments

* fix typo
JaySon-Huang pushed a commit to JaySon-Huang/tiflash that referenced this pull request Sep 5, 2019
* Segment support range scan

* Bug fix: ColumnVector insertRangeFrom out of range

* Only read tag column when necessary

* print more info on sidLowerBound exception

* Refactor DeltaMergeBlockInputStream

* Optimize DMVersionFilterBlockInputStream, try unroll loops.

* Support multi range read

* bug fix

* Optimize synchronization mechanism between read/write thread, decrease latency.

* Fix testes

* Address comments

* fix typo
JaySon-Huang pushed a commit to JaySon-Huang/tiflash that referenced this pull request Sep 12, 2019
* Segment support range scan

* Bug fix: ColumnVector insertRangeFrom out of range

* Only read tag column when necessary

* print more info on sidLowerBound exception

* Refactor DeltaMergeBlockInputStream

* Optimize DMVersionFilterBlockInputStream, try unroll loops.

* Support multi range read

* bug fix

* Optimize synchronization mechanism between read/write thread, decrease latency.

* Fix testes

* Address comments

* fix typo
JaySon-Huang pushed a commit to JaySon-Huang/tiflash that referenced this pull request Sep 18, 2019
* Segment support range scan

* Bug fix: ColumnVector insertRangeFrom out of range

* Only read tag column when necessary

* print more info on sidLowerBound exception

* Refactor DeltaMergeBlockInputStream

* Optimize DMVersionFilterBlockInputStream, try unroll loops.

* Support multi range read

* bug fix

* Optimize synchronization mechanism between read/write thread, decrease latency.

* Fix testes

* Address comments

* fix typo
JaySon-Huang pushed a commit to JaySon-Huang/tiflash that referenced this pull request Sep 23, 2019
* Segment support range scan

* Bug fix: ColumnVector insertRangeFrom out of range

* Only read tag column when necessary

* print more info on sidLowerBound exception

* Refactor DeltaMergeBlockInputStream

* Optimize DMVersionFilterBlockInputStream, try unroll loops.

* Support multi range read

* bug fix

* Optimize synchronization mechanism between read/write thread, decrease latency.

* Fix testes

* Address comments

* fix typo
JaySon-Huang pushed a commit that referenced this pull request Sep 26, 2019
* Segment support range scan

* Bug fix: ColumnVector insertRangeFrom out of range

* Only read tag column when necessary

* print more info on sidLowerBound exception

* Refactor DeltaMergeBlockInputStream

* Optimize DMVersionFilterBlockInputStream, try unroll loops.

* Support multi range read

* bug fix

* Optimize synchronization mechanism between read/write thread, decrease latency.

* Fix testes

* Address comments

* fix typo
JaySon-Huang pushed a commit to JaySon-Huang/tiflash that referenced this pull request Oct 17, 2019
* Segment support range scan

* Bug fix: ColumnVector insertRangeFrom out of range

* Only read tag column when necessary

* print more info on sidLowerBound exception

* Refactor DeltaMergeBlockInputStream

* Optimize DMVersionFilterBlockInputStream, try unroll loops.

* Support multi range read

* bug fix

* Optimize synchronization mechanism between read/write thread, decrease latency.

* Fix testes

* Address comments

* fix typo
JaySon-Huang pushed a commit to JaySon-Huang/tiflash that referenced this pull request Oct 18, 2019
* Segment support range scan

* Bug fix: ColumnVector insertRangeFrom out of range

* Only read tag column when necessary

* print more info on sidLowerBound exception

* Refactor DeltaMergeBlockInputStream

* Optimize DMVersionFilterBlockInputStream, try unroll loops.

* Support multi range read

* bug fix

* Optimize synchronization mechanism between read/write thread, decrease latency.

* Fix testes

* Address comments

* fix typo
JaySon-Huang pushed a commit that referenced this pull request Oct 22, 2019
* Segment support range scan

* Bug fix: ColumnVector insertRangeFrom out of range

* Only read tag column when necessary

* print more info on sidLowerBound exception

* Refactor DeltaMergeBlockInputStream

* Optimize DMVersionFilterBlockInputStream, try unroll loops.

* Support multi range read

* bug fix

* Optimize synchronization mechanism between read/write thread, decrease latency.

* Fix testes

* Address comments

* fix typo
JaySon-Huang pushed a commit to JaySon-Huang/tiflash that referenced this pull request Oct 23, 2019
* Segment support range scan

* Bug fix: ColumnVector insertRangeFrom out of range

* Only read tag column when necessary

* print more info on sidLowerBound exception

* Refactor DeltaMergeBlockInputStream

* Optimize DMVersionFilterBlockInputStream, try unroll loops.

* Support multi range read

* bug fix

* Optimize synchronization mechanism between read/write thread, decrease latency.

* Fix testes

* Address comments

* fix typo
JaySon-Huang pushed a commit to JaySon-Huang/tiflash that referenced this pull request Oct 30, 2019
* Segment support range scan

* Bug fix: ColumnVector insertRangeFrom out of range

* Only read tag column when necessary

* print more info on sidLowerBound exception

* Refactor DeltaMergeBlockInputStream

* Optimize DMVersionFilterBlockInputStream, try unroll loops.

* Support multi range read

* bug fix

* Optimize synchronization mechanism between read/write thread, decrease latency.

* Fix testes

* Address comments

* fix typo
JaySon-Huang pushed a commit to JaySon-Huang/tiflash that referenced this pull request Nov 1, 2019
* Segment support range scan

* Bug fix: ColumnVector insertRangeFrom out of range

* Only read tag column when necessary

* print more info on sidLowerBound exception

* Refactor DeltaMergeBlockInputStream

* Optimize DMVersionFilterBlockInputStream, try unroll loops.

* Support multi range read

* bug fix

* Optimize synchronization mechanism between read/write thread, decrease latency.

* Fix testes

* Address comments

* fix typo
JaySon-Huang pushed a commit to JaySon-Huang/tiflash that referenced this pull request Nov 1, 2019
* Segment support range scan

* Bug fix: ColumnVector insertRangeFrom out of range

* Only read tag column when necessary

* print more info on sidLowerBound exception

* Refactor DeltaMergeBlockInputStream

* Optimize DMVersionFilterBlockInputStream, try unroll loops.

* Support multi range read

* bug fix

* Optimize synchronization mechanism between read/write thread, decrease latency.

* Fix testes

* Address comments

* fix typo
JaySon-Huang pushed a commit to JaySon-Huang/tiflash that referenced this pull request Nov 5, 2019
* Segment support range scan

* Bug fix: ColumnVector insertRangeFrom out of range

* Only read tag column when necessary

* print more info on sidLowerBound exception

* Refactor DeltaMergeBlockInputStream

* Optimize DMVersionFilterBlockInputStream, try unroll loops.

* Support multi range read

* bug fix

* Optimize synchronization mechanism between read/write thread, decrease latency.

* Fix testes

* Address comments

* fix typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants