-
Notifications
You must be signed in to change notification settings - Fork 216
raft: paginate the unapplied config changes scan #32
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
Conversation
tbg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is what I expected, I'm a bit surprised to see the discussion on it. Perhaps the two of you can clue me in on what the discussion is about, I was mostly confused reading it, so am likely missing something.
Signed-off-by: Pavel Kalinnikov <[email protected]>
Signed-off-by: Pavel Kalinnikov <[email protected]>
Signed-off-by: Pavel Kalinnikov <[email protected]>
Signed-off-by: Pavel Kalinnikov <[email protected]>
|
The PR looks good to me. Can you rebase this PR although there is no conflict? There are huge differences between this PR and the main branch. |
ahrtr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Nice improvement! thx @pavelkalinnikov
Signed-off-by: Pavel Kalinnikov <[email protected]>
This includes etcd-io/raft#32 which fixes an out-of-memory scenario during election with large unapplied Raft logs. Part of cockroachdb#104402 Epic: none Release note (bug fix): Fixed a bug in upstream etcd-io/raft which could result in pulling unlimited amount of log into memory, and lead to out-of-memory situations. With the fix, the log scan has a limited memory footprint.
104483: go.mod: upgrade etcd-io/raft to 515b142 r=tbg a=pavelkalinnikov This includes etcd-io/raft#32 which fixes an out-of-memory scenario during election with large unapplied Raft logs. Part of #104402 Epic: none Release note (bug fix): Fixed a bug in upstream etcd-io/raft which could result in pulling unlimited amount of log into memory, and lead to out-of-memory situations. With the fix, the log scan has a limited memory footprint. Co-authored-by: Pavel Kalinnikov <[email protected]>
This commit patches etcd-io/raft#32 which fixes an out-of-memory scenario during election with large unapplied Raft logs. The patch does apply and build cleanly, so there is a fixup commit on top. Commits included: 313e96ce raft: factor out unapplied config changes check a22dbb1e raft: don't scan unapplied entries if applied==committed 2cb76edb raft: inline numOfPendingConf() != 0 check d980ecd4 raft: paginate the unapplied config changes scan 1df76294 raft: add raftLog.scan method for paginated reads Signed-off-by: Pavel Kalinnikov <[email protected]>
This commit fixes the build after porting etcd-io/raft#32. Signed-off-by: Pavel Kalinnikov <[email protected]>
…-read raft: paginate the unapplied config changes scan There is a 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. Signed-off-by: Pavel Kalinnikov <[email protected]>
This dependency upgrade includes a patched PR 32 from etcd-io/raft which fixes an out-of-memory scenario during election with large unapplied Raft logs. Part of cockroachdb#104402 Epic: none Release note (bug fix): Fixed a bug in upstream etcd-io/raft which could result in pulling unlimited amount of log into memory, and lead to out-of-memory situations. With the fix, the log scan has a limited memory footprint. Release justification: fixing a bug after a customer escalation
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. Signed-off-by: Neil Shen <[email protected]>
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. Signed-off-by: Neil Shen <[email protected]>
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 <[email protected]>
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 <[email protected]>
There is a 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 toMaxCommittedSizePerReady. It also terminates the scan early if a config change has been found.An example effect of this change can be seen below (memory usage in CockroachDB). Before, there was a large spike to 12 GiB:
After, the scan was smeared out, and the memory usage is stable around 1 GiB: