Merge pull request #14078 from ahrtr/checkpoint_reset

Clean up the local variable cps so that it will not continue to schedule checkpoint
This commit is contained in:
Benjamin Wang 2022-05-31 07:56:53 +08:00 committed by GitHub
commit 08f4c340eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -646,10 +646,10 @@ func (le *lessor) revokeExpiredLeases() {
// checkpointScheduledLeases finds all scheduled lease checkpoints that are due and
// submits them to the checkpointer to persist them to the consensus log.
func (le *lessor) checkpointScheduledLeases() {
var cps []*pb.LeaseCheckpoint
// rate limit
for i := 0; i < leaseCheckpointRate/2; i++ {
var cps []*pb.LeaseCheckpoint
le.mu.Lock()
if le.isPrimary() {
cps = le.findDueScheduledCheckpoints(maxLeaseCheckpointBatchSize)