mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Move the local variable cps into the loop so that it will not continue to schedule checkpoints after it steps down the leader
This commit is contained in:
parent
ce77d83ee6
commit
1d482bfc08
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user