Skip to content

Commit

Permalink
logbackup: do not resolve locks frequently when log-backup task did n…
Browse files Browse the repository at this point in the history
…ot exist

Signed-off-by: joccau <zak.zhao@pingcap.com>
  • Loading branch information
joccau committed Jan 22, 2023
1 parent f7c87c8 commit bb5818b
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 bb5818b

Please sign in to comment.