Skip to content
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

autoid_service: fix potential 'duplicated entry' error when tidb exit for AUTO_ID_CACHE=1 tables #46445

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autoid_service/autoid.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@

// Close closes the Service and clean up resource.
func (s *Service) Close() {
if s.leaderShip != nil {
if s.leaderShip != nil && s.leaderShip.IsOwner() {

Check warning on line 328 in autoid_service/autoid.go

View check run for this annotation

Codecov / codecov/patch

autoid_service/autoid.go#L328

Added line #L328 was not covered by tests
for k, v := range s.autoIDMap {
if v.base > 0 {
err := v.forceRebase(context.Background(), s.store, k.dbID, k.tblID, v.base, v.isUnsigned)
Expand Down