Skip to content

Commit

Permalink
autoid_service: fix potential 'duplicated entry' error when tidb exit…
Browse files Browse the repository at this point in the history
… for AUTO_ID_CACHE=1 tables (#46445) (#46500)

close #46444
  • Loading branch information
ti-chi-bot authored Oct 11, 2023
1 parent 188da2d commit ef54d6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoid_service/autoid.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func MockForTest(store kv.Storage) autoid.AutoIDAllocClient {

// Close closes the Service and clean up resource.
func (s *Service) Close() {
if s.leaderShip != nil {
if s.leaderShip != nil && s.leaderShip.IsOwner() {
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

0 comments on commit ef54d6c

Please sign in to comment.