KVStore: Defer deleting locks until after the committed data has been written to storage#9921
Conversation
JaySon-Huang
left a comment
There was a problem hiding this comment.
Should we apply the change of remove write storage in doLearnerRead in the same PR?
Rest LGTM
This PR is the peconditions of The next PR will |
I think it is better that we firstly merge this PR, and let it run for a week for all relevant tests to make sure this change is less likely to have problems. If we remove the |
[LGTM Timeline notifier]Timeline:
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CalvinNeo, JaySon-Huang 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 |
|
@JinheLin: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests
If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: close #9922
Problem Summary:
If we directly remove the logic of the read thread writing to the storage engine during learner reads in the existing code, it would cause concurrency control problems that could result in missing some of the latest data. The concurrency logic is as follows:
The root cause of this issue is that the Raft thread removes the lock before writing the data to the storage engine.
What is changed and how it works?
Removes locks after committed data has been written to the storage.
Rename
Region::removetoRegion:removeDebugbecause this function only used to tests.Check List
Tests
Unit test
Integration test
Manual test (add detailed scripts or steps below)
No code
Side effects
Documentation
Release note