From 916145245753dd11ff4a4732e302df692666f2d0 Mon Sep 17 00:00:00 2001 From: 3pointer Date: Mon, 23 Jan 2023 11:11:50 +0800 Subject: [PATCH] log-backup: do not resolve locks frequently when log-backup task did not exist (#40760) (#40766) ref pingcap/tidb#40759 --- store/gcworker/gc_worker.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/store/gcworker/gc_worker.go b/store/gcworker/gc_worker.go index 054ec83ee7e8a..7d45ffd25dd49 100644 --- a/store/gcworker/gc_worker.go +++ b/store/gcworker/gc_worker.go @@ -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. @@ -1790,7 +1790,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)