PageStorage: Mvcc directory (without GC/restore)#3637
PageStorage: Mvcc directory (without GC/restore)#3637ti-chi-bot merged 17 commits intopingcap:masterfrom
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. |
318da99 to
e6bcc78
Compare
|
/run-all-tests |
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
1e9906e to
661369f
Compare
Signed-off-by: JaySon-Huang <tshent@qq.com>
…st entry Signed-off-by: JaySon-Huang <tshent@qq.com>
20f3fab to
51fad8d
Compare
3e9bb5e to
b5380c4
Compare
|
/run-all-tests |
Signed-off-by: JaySon-Huang <tshent@qq.com>
|
/run-all-tests |
Signed-off-by: JaySon-Huang <tshent@qq.com>
|
@jiaqizho PTAL |
|
/run-all-tests |
Signed-off-by: JaySon-Huang <tshent@qq.com>
|
Coverage detail: https://ci-internal.pingcap.net/job/tics_ghpr_unit_test/415/cobertura/ lines: 42.5% (47422 out of 111506) |
| } | ||
|
|
||
| // stage 2, persisted the changes to WAL | ||
| // wal.apply(edit); |
There was a problem hiding this comment.
Why comment out this line?
There was a problem hiding this comment.
Because WALStore has not been implemented in this PR (but its tests don't care about this stage). So I comment out this line.
| else | ||
| ++iter; | ||
| } | ||
| throw Exception("Not implemented", ErrorCodes::NOT_IMPLEMENTED); |
There was a problem hiding this comment.
Then after clean up snapshots, it must throw an exception, can we make a test version of this method or just not do GC ?
There was a problem hiding this comment.
This PR doesn't focus on GC. So I won't test/fix this line in this PR.
| { | ||
| assert(del == true); | ||
| } | ||
| explicit EntryOrDelete(const PageEntryV3 & entry_) |
There was a problem hiding this comment.
Just a suggestion, can we use nullptr and a entry ptr to replace it?
looks strange to me....
There was a problem hiding this comment.
I don't think it is a good idea for using nullptr representing "delete". It will cause
- many small heap allocation/freeing
- need to dereference to get the actual entry, slowing down the query performance
There was a problem hiding this comment.
So why we do not use real ptr to replace it?
ex.
std::map<PageVersionType, PageEntryV3 *> entries;
it does not mean entry will be in heap.
and I don't agree with many small heap allocation/freeing this point.
If lots of entries are in the stack, the single thread stack is 8M. Not sure will get an error from it.
Anyway, it is just a suggestion(change or not, all is fine), In my opinion, the expression of pointers and nullptr would be more appropriate here.
| { | ||
| assert(del == true); | ||
| } | ||
| explicit EntryOrDelete(const PageEntryV3 & entry_) |
There was a problem hiding this comment.
So why we do not use real ptr to replace it?
ex.
std::map<PageVersionType, PageEntryV3 *> entries;
it does not mean entry will be in heap.
and I don't agree with many small heap allocation/freeing this point.
If lots of entries are in the stack, the single thread stack is 8M. Not sure will get an error from it.
Anyway, it is just a suggestion(change or not, all is fine), In my opinion, the expression of pointers and nullptr would be more appropriate here.
|
|
||
| void PageDirectory::apply(PageEntriesEdit && edit) | ||
| { | ||
| std::unique_lock write_lock(table_rw_mutex); // TODO: It is totally serialized, make it a pipeline |
There was a problem hiding this comment.
unique_lock/shared_lock is more suitable for write/read lock because table_rw_mutex is a shared_mutex.
|
/rebuild |
|
/run-all-tests |
|
Coverage detail: https://ci-internal.pingcap.net/job/tics_ghpr_unit_test/548/cobertura/ lines: 42.7% (47925 out of 112314) |
|
/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: 7e14e59 |
|
@JaySon-Huang: 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. |
|
Coverage detail: https://ci-internal.pingcap.net/job/tics_ghpr_unit_test/569/cobertura/ lines: 42.7% (48015 out of 112357) |
What problem does this PR solve?
Issue Number: related to #3594
Problem Summary:
This PR focus on implementing the apply changes to / read PageEntry from MVCC directory.
These functions will be implemented in the following PRs:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note