PageStorage: Fine grained lock on mvcc map#4137
Conversation
|
[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. DetailsReviewer can indicate their review by submitting an approval review. |
|
/run-unit-test |
8e4d5ca to
a906d66
Compare
Coverage for changed filesCoverage summaryfull coverage report (for internal network access only) |
|
/run-unit-test |
Coverage for changed filesCoverage summaryfull coverage report (for internal network access only) |
| PageDirectory::getEntriesByBlobIds(const std::vector<BlobFileId> & blob_ids) const | ||
| { | ||
| std::map<BlobFileId, PageIdAndVersionedEntries> blob_versioned_entries; | ||
| std::unordered_set<BlobFileId> blob_id_set; |
There was a problem hiding this comment.
why we need change vector to set here?
There was a problem hiding this comment.
I use it for these checking in line 575 to 581:
https://github.com/pingcap/tics/blob/7e4acdcebe5e9a3a38ceb5a896db89616a4b4673/dbms/src/Storages/Page/V3/PageDirectory.cpp#L575-L581
|
/merge |
|
@JaySon-Huang: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. 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. |
|
@JaySon-Huang: DetailsIn response to this:
Instructions 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. |
Coverage for changed filesCoverage summaryfull coverage report (for internal network access only) |
|
/merge |
|
@JaySon-Huang: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. 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. |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 997930f |
Coverage for changed filesCoverage summaryfull coverage report (for internal network access only) |
What problem does this PR solve?
Issue Number: ref #3594
Problem Summary:
Now function
PageDirectory::gcandPageDirectory::getEntriesByBlobIdstake the lock on the whole mvcc map for the iterating.By utilizing
std::map::insertthat "No iterators or references are invalidated" https://en.cppreference.com/w/cpp/container/map/insert, we can refine the lock granularity to be more smaller.What is changed and how it works?
PageDirectory::gcandPageDirectory::getEntriesByBlobIdsEXPECT_TRUE(isSameEntry(...Check List
Tests
Side effects
Documentation
Release note