-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
log-backup: use the span tree(instead of the naïve algorithm) to calculate the checkpoint #39122
Conversation
Signed-off-by: hillium <[email protected]>
Signed-off-by: hillium <[email protected]>
Signed-off-by: hillium <[email protected]>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: hillium <[email protected]>
Signed-off-by: hillium <[email protected]>
Signed-off-by: hillium <[email protected]>
Signed-off-by: hillium <[email protected]>
…n-tree Signed-off-by: hillium <[email protected]>
Signed-off-by: hillium <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reset LGTM
Signed-off-by: hillium <[email protected]>
Signed-off-by: hillium <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 7ba6318
|
/run-mysql-test |
1 similar comment
/run-mysql-test |
TiDB MergeCI notify🔴 Bad News! New failing [1] after this pr merged.
|
What problem does this PR solve?
Issue Number: close #N/A
Problem Summary:
We were using a naive algorithm to advance the checkpoint before:
it simply maintains a mapping from
timestamp
toranges
. Which would probably store too many radiant items.What is changed and how it works?
This PR added a new data structure named
spans.ValueSorted
in the code.It contains a non-overlapped, full range tree as the "primary key" and a binary search tree with
timestamp
as keyrange
as value for indexing.The primary tree has some characteristics:
For keeping these characteristics, the interface it provides is limited, when we inserting some ranges into it, it would "merge" those new ranges into its current state.
An example here:
Each flush would generate a new checkpoint: usually, it updates the checkpoint of some range by the regions it flushed. In a more detailed view, you can imagine the key space as a line:
Once querying a checkpoint of some range, we simply choose the minimal of all its intersected ranges.
A flush would update the checkpoint of a subrange. At this time, we fill the points in the range with max(new_checkpoint, old_checkpoint), we are going to call this step Merge, just like:
Would Give:
Check List
Tests
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.