Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

feat(raft): paginate the unapplied config changes scan #2

Merged
merged 1 commit into from
Oct 18, 2023
Merged

Conversation

tisonkun
Copy link
Owner

Fix potentially unlimited memory usage spike possible in raft.hup() which reads all unapplied committed entries in order to check that there are no unapplied config changes. This PR paginates this scan so that the spike is limited to MaxCommittedSizePerReady. It also terminates the scan early if a config change has been found.

It is ported from etcd-io/raft#32.

It is ported from tikv/raft-rs#530.

Fix potentially unlimited memory usage spike possible in raft.hup() which reads
all unapplied committed entries in order to check that there are no unapplied
config changes. This PR paginates this scan so that the spike is limited to
MaxCommittedSizePerReady. It also terminates the scan early if a config change
has been found.

It is ported from etcd-io/raft#32.
It is ported from tikv/raft-rs#530.

Signed-off-by: tison <wander4096@gmail.com>
@tisonkun tisonkun changed the title raft: paginate the unapplied config changes scan feat(raft): paginate the unapplied config changes scan Oct 18, 2023
@tisonkun tisonkun merged commit eb43518 into main Oct 18, 2023
4 checks passed
@tisonkun tisonkun deleted the paginate branch October 18, 2023 02:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant