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

log-backup: do not resolve locks frequently when log-backup task did not exist #40760

Merged
merged 2 commits into from
Jan 22, 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
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