-
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
PageStorage: Mvcc directory (without GC/restore) #3637
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. Reviewer 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why comment out this line?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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,
There still remain many things to do. :)
{ | ||
assert(del == true); | ||
} | ||
explicit EntryOrDelete(const PageEntryV3 & entry_) |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lock_guard?
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.
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. 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. |
This pull request has been accepted and is ready to merge. Commit 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. 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 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