-
Notifications
You must be signed in to change notification settings - Fork 411
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
improve ps gc speed by dumping snapshot from memory directly #7668
Conversation
/rebuild |
/run-all-tests |
/rebuild |
/run-integration-test |
cc293ce
to
cc2038d
Compare
/run-unit-test |
/run-all-tests |
/run-all-tests |
/run-integration-test |
1 similar comment
/run-integration-test |
/run-all-tests |
/run-integration-test |
1 similar comment
/run-integration-test |
Co-authored-by: JaySon <[email protected]>
/run-all-tests |
Co-authored-by: JaySon <[email protected]>
8a47ca1
to
0232dea
Compare
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: flowbehappy, JaySon-Huang 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:
|
/merge |
/run-all-tests |
/run-unit-test |
What problem does this PR solve?
Issue Number: ref #6827
Problem Summary: Previously, when dumping snapshot for
PageDirectory
, we load all target wal files and create a temp PageDirectory for dumping. And after dumping the snapshot, we can reclaim all the target wal files.But under heavy write scenario, the dump snapshot speed is a little slow. This will make the number of wal files keep increasing and make the process of dumping snapshot cost more and more memory.
What is changed and how it works?
Change the type of
being_ref_count
fromInt64
toMultiVersionRefCount *
;being_ref_count
is nullptr, it means1
;PageVersion -> RefCount
insideMultiVersionRefCount
;getLatestRefCount
andappendRefCount
;decrLatestRefCountInSnap
. And it will also reclaim older version of ref count;When dumping snapshot, ref count increasing caused by new ref page will just be appended to
MultiVersionRefCount
, so it won't affect the ref count value that the snapshot can see.GC process can still change ref count value for a snapshot, but it doesn't matter because gc won't run concurrently with dumping snapshot.
Check List
Tests
Side effects
Documentation
Release note