-
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
Handle orphan write cf key from a raftstore v2 tablet snapshot #7657
Handle orphan write cf key from a raftstore v2 tablet snapshot #7657
Conversation
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
How about converting to draft before ready to avoid seeds messages to reviewers? |
ff67124
to
d40931a
Compare
return std::nullopt; | ||
} | ||
// Otherwise, this is still a hard error. | ||
// TODO We still need to check if there are remained orphan keys after we have applied after peer's flushed_index. |
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.
This will be done when tikv support a deadline_index.
/run-all-tests |
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
4aee768
to
d073587
Compare
/run-all-tests |
d073587
to
9ecd405
Compare
Co-authored-by: JaySon <tshent@qq.com>
Co-authored-by: JaySon <tshent@qq.com>
Co-authored-by: JaySon <tshent@qq.com>
Co-authored-by: JaySon <tshent@qq.com>
Co-authored-by: JaySon <tshent@qq.com>
Co-authored-by: JaySon <tshent@qq.com>
Co-authored-by: JaySon <tshent@qq.com>
Co-authored-by: JaySon <tshent@qq.com>
/run-all-tests |
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, lidezhu 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:
|
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@CalvinNeo can we unhold this PR and get it merged? |
/unhold |
What problem does this PR solve?
Issue Number: ref #7568
Problem Summary:
Raftstore v2 snapshot may contain extra write key which is from later raft log index than the snapshot has claimed. We decide to suppress this error rather than throwing an exception.
We will keep track of these orphan key, and throw an exception later if we are sure these keys are orphan because of data loss rather than an eager-replicated data.
What is changed and how it works?
The suppress part:
/engine_type
response from TiKV.OrphanKeyInfo
struct when prehandling snapshot.OrphanKeyInfo
when insert into write cf.OrphanKeyInfo
first. If the key is registered inOrphanKeyInfo
, consider it as a soft error.The async checking part:
deadline_index
sent from TiKV's snapshot which must GE thansnapshot_index
in inOrphanKeyInfo
.applied_index
is proceeded exceed thedeadline_index
, check if theOrphanKeyInfo
is cleared. Otherwise raise a hard error.What is not included:
PreHandleSnapshot
requiresdeadline_index
being sent from TiKV. So we can have async check only after TiKV support this.NOTE
Orphan keys will not be iterated by region read scanner, so it will not be presented in
data_list_read
, so it will not be removed as a committed entry. We don't eagerly do that, since it brings extra cost. These keys will either be removed when its default counterpart arrives in the following raft log, or being reported as an error when exceeds deadline_index.Check List
Tests
Side effects
Documentation
Release note