Skip to content

Commit f4008d6

Browse files
storage: re-enqueue Raft groups on paginated application
Fixes cockroachdb#31330. This change re-enqueues Raft groups for processing immediately if they still have more to do after a Raft ready iteration. This comes up in practice when a Range has sufficient load to force Raft application pagination. See cockroachdb#31330 for a discussion on the symptoms this can cause. Release note (bug fix): Fix bug where Raft followers could fall behind leaders will entry application, causing stalls during splits.
1 parent 2fdb530 commit f4008d6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/storage/replica.go

+8
Original file line numberDiff line numberDiff line change
@@ -3837,6 +3837,14 @@ func (r *Replica) handleRaftReadyRaftMuLocked(
38373837
const expl = "during advance"
38383838
if err := r.withRaftGroup(func(raftGroup *raft.RawNode) (bool, error) {
38393839
raftGroup.Advance(rd)
3840+
3841+
// If the Raft group still has more to process then we immediately
3842+
// re-enqueue it for another round of processing. This is possible if
3843+
// the group's committed entries were paginated due to size limitations
3844+
// and we didn't apply all of them in this pass.
3845+
if raftGroup.HasReady() {
3846+
r.store.enqueueRaftUpdateCheck(r.RangeID)
3847+
}
38403848
return true, nil
38413849
}); err != nil {
38423850
return stats, expl, errors.Wrap(err, expl)

0 commit comments

Comments
 (0)