-
Notifications
You must be signed in to change notification settings - Fork 409
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
KVStore: Fix spurious region overlap when two region are both applying snapshots #9330
Conversation
dm_storage->deleteRange(new_key_range, context.getSettingsRef()); | ||
// We must flush the deletion to the disk here, because we only flush new range when persisting this region later. | ||
dm_storage->flushCache(context, old_key_range, /*try_until_succeed*/ true); | ||
dm_storage->flushCache(context, new_key_range, /*try_until_succeed*/ true); |
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.
Why here is changed to delete the new_key_range?
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.
Consider:
- apply snapshot a of range [0..100)
- apply snapshot b of range [50..100)
- apply snapshot a' of range [0..50)
In 3, we could clean the old range [0..100), which covers the written data of snapshot b in stage 2
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.
If we only need to delete the existing data on the new_range, then the following code of ingestFiles(..., /*clear_data_in_range=*/true, ...)
can do it. We don't need this branch.
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.
Fixed
Signed-off-by: Calvin Neo <calvinneo1995@gmail.com>
Are these failed tests related to your changes?
|
Co-authored-by: JaySon <tshent@qq.com>
… fix-simu-snapshot
Co-authored-by: Lloyd-Pottiger <60744015+Lloyd-Pottiger@users.noreply.github.com>
Co-authored-by: JaySon <tshent@qq.com>
/hold |
… fix-simu-snapshot
/unhold |
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.
Rest LGTM
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JaySon-Huang, Lloyd-Pottiger The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
…g snapshots (pingcap#9330) close pingcap#9329 Signed-off-by: Calvin Neo <calvinneo1995@gmail.com> Co-authored-by: JaySon <tshent@qq.com> Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #9329
Problem Summary:
See the issue.
What is changed and how it works?
new_region
rather thanold_region
.Check List
Tests
Side effects
Documentation
Release note