Repository navigation
Prune requests bigger than RequestMaxBytes after a reconfig - #755
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
Signed-off-by: Raphael Fakhri <153192858+RaphaelFakhri@users.noreply.github.com>
HagarMeir
reviewed
Nov 5, 2026
HagarMeir
left a comment
Contributor
There was a problem hiding this comment.
Thanks for finding this and for the fix! The prune change looks right to me.
One request: recconfigToInt and recconfigToUint in test/reconfig.go set RequestMaxBytes from RequestBatchMaxBytes. The new test passes only because it sets both to 1024, so it doesn't really check the new predicate against RequestMaxBytes. Could you map RequestMaxBytes from its own field in both helpers?
(This review was written by Claude, an AI assistant, for Hagar Meir.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
After a reconfig,
Consensus.reconfigprunes the request pool of requests that the new configuration makes invalid, but it checks them only withVerifier.VerifyRequest. A request that was accepted under a largerRequestMaxBytesstays in the pool.If the reconfig also lowers
RequestBatchMaxBytesbelow the size of that request, the request can't fit in any batch.Pool.NextRequestsreturns an empty batch marked as full, so the leader proposes nothing and spins inController.propose. The requests behind it wait untilRequestAutoRemoveTimeoutexpires.This change makes the reconfig prune predicate also reject requests bigger than the new
RequestMaxBytes.Configuration.Validatealready checks thatRequestMaxBytesisn't bigger thanRequestBatchMaxBytes, so every request left in the pool fits in a batch.Testing
TestOversizedRequestPrunedAfterReconfigintest/reconfig_test.go: a follower holds a 2 KB request, a reconfig setsRequestMaxBytesandRequestBatchMaxBytesto 1024, and the test checks that the pool is pruned and the cluster still delivers a new request. Without the fix, the test fails because the request stays in the pool.go test -count 1 -race ./pkg/... ./internal/...,go test ./test/ -count=1andgolangci-lint run ./...pass.Fixes #754