-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
gcworker: skip GC if the safe point isn't changed #22482
Conversation
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
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, but actually I hope if there's a way to make the lastSafePoint
field in mysql.tidb able to store the ts value as well as displaying the time format.
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
/merge |
/run-all-tests |
/run-all-tests |
@@ -324,7 +324,7 @@ func (w *GCWorker) checkPrepare(ctx context.Context) (bool, uint64, error) { | |||
if err != nil || !ok { | |||
return false, 0, errors.Trace(err) | |||
} | |||
newSafePoint, newSafePointValue, err := w.calculateNewSafePoint(ctx, now) | |||
newSafePoint, newSafePointValue, err := w.calcNewSafePoint(ctx, now) |
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 new safe point is saved before locks are resolved. Then, if we fail to resolve locks and we don't advance the global min start ts, GC will not retry.
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.
How about saving it after GC is done?
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 think it ok.
Signed-off-by: youjiali1995 zlwgx1023@gmail.com
What problem does this PR solve?
Issue Number: close #15007 #16602
Problem Summary:
skip GC if the safe point isn't changed
What is changed and how it works?
What's Changed:
skip GC if the safe point isn't changed
Related changes
Check List
Tests
Release note