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.
Why here is changed to delete the new_key_range?
There was a problem hiding this comment.
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.
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.
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 |
|
[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 DetailsNeeds 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_regionrather thanold_region.Check List
Tests
Side effects
Documentation
Release note