-
Notifications
You must be signed in to change notification settings - Fork 729
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
gc: Implement compatibility methods and GetAllKeyspacesGCStates
method to GCStateManager
#9134
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Skipping CI for Draft Pull Request. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9134 +/- ##
==========================================
+ Coverage 75.72% 75.79% +0.06%
==========================================
Files 477 477
Lines 73437 73584 +147
==========================================
+ Hits 55612 55773 +161
+ Misses 14342 14331 -11
+ Partials 3483 3480 -3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
GCStateManager
which is planned to be the replacement of SafePointManager
.GCStateManager
which is planned to be the replacement of SafePointManager
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JmPotato 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:
|
Signed-off-by: MyonKeminta <[email protected]>
pkg/gc/gc_state_manager.go
Outdated
@@ -194,9 +218,23 @@ func (m *GCStateManager) advanceGCSafePointImpl(keyspaceID uint32, target uint64 | |||
return wb.SetGCSafePoint(keyspaceID, target) | |||
}) | |||
if err != nil { | |||
log.Error("failed to advance GC safe point", | |||
zap.Uint32("keyspace-idD", keyspaceID), |
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.
zap.Uint32("keyspace-idD", keyspaceID), | |
zap.Uint32("keyspace-id", keyspaceID), |
pkg/gc/gc_state_manager.go
Outdated
|
||
// saturatingDuration returns a duration calculated by multiplying the given `ratio` and `base`, truncated within the | ||
// range [0, math.MaxInt64] to avoid negative value and overflowing. | ||
func saturatingDuration(ratio int64, base time.Duration) time.Duration { |
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 do we need this function?
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.
It's used for avoiding overflow after multiplication, so that it prevents the user from specifying a too large value and causing undefined behavior.
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.
Btw I renamed it to saturatingMultiplyDuration
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.
Will it cover up mistakes? BTW, we have enabled durationcheck linter.
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
} | ||
if res.NewTxnSafePoint != newServiceSafePoint { | ||
minServiceSafePoint = &endpoint.ServiceSafePoint{ | ||
ServiceID: "__pseudo_service:" + res.BlockerDescription, |
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.
Is it possible to unify the format of ServiceID? __pseudo_service: TiDBMinStartTS { Key: %+q, MinStartTS: %d }
looks wired.
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.
Do you have any suggestion?
/hold |
What problem does this PR solve?
Issue Number: Ref #8978
What is changed and how does it work?
Blocked by:
storage/endpoint: Add a new componentGCStateStorage
andGCStateProvider
to storage/endpoints as the new storage layer for GC related metadata #9109GCStateManager
which is planned to be the replacement ofSafePointManager
#9169This PR is branched from #9109 which is not merged yet. If you want to view the diff in this PR without being disturbed by changes from #9109, please see: MyonKeminta/pd@m/gc-state-storage...MyonKeminta:pd:m/gc-state-managerPart of this PR is split out to #9169 . Please merge #9169 first. To see changes in this PR based on #9169, see: MyonKeminta/pd@m/gc-state-manager-partial...MyonKeminta:pd:m/gc-state-manager
Check List
Tests
Code changes
Side effects
Related changes
Release note