Skip to content

Commit

Permalink
log-backup: do not resolve locks frequently when log-backup task did …
Browse files Browse the repository at this point in the history
…not exist (#40760)

ref #40759
  • Loading branch information
joccau authored Jan 22, 2023
1 parent 6ebbe64 commit 1e0956d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions store/gcworker/gc_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type GCWorker struct {
batchResolveLocks func(locks []*txnlock.Lock, regionID tikv.RegionVerID, safepoint uint64) (ok bool, err error)
resolveLocks func(locks []*txnlock.Lock, lowResolutionTS uint64) (int64, error)
}
logBackupEnabled bool
logBackupEnabled bool // check log-backup task existed.
}

// NewGCWorker creates a GCWorker instance.
Expand Down Expand Up @@ -1794,7 +1794,7 @@ func (w *GCWorker) checkLeader(ctx context.Context) (bool, error) {
se := createSession(w.store)
defer se.Close()

w.logBackupEnabled = utils.CheckLogBackupEnabled(se)
w.logBackupEnabled = utils.IsLogBackupInUse(se)
_, err := se.ExecuteInternal(ctx, "BEGIN")
if err != nil {
return false, errors.Trace(err)
Expand Down

0 comments on commit 1e0956d

Please sign in to comment.