Repository navigation
test(sdk): fail when sends to split partition primaries move the session - #4437
Closed
almostintuitive wants to merge 1 commit into
Closed
almostintuitive wants to merge 1 commit into
almostintuitive wants to merge 1 commit into
Conversation
A producer alternating between two partitions whose primaries are on different nodes waits out two transient refusal windows (about 4s) and moves its only session on every send. Polls avoid this through PollRouter; sends have no equivalent. The new test builds on seed_split_primaries: partition 0 keeps its primary through a metadata-only election, and partition 1, created afterwards, is seeded onto the metadata leader. After a warm-up send to each partition it alternates four sends and asserts the session never moves. It is ignored with apache#4436 so default CI stays green. Relates to apache#4436 Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 task
|
Thanks for the PR. It is labeled Slash commands (own line, regular comment) move it around the queue:
See CONTRIBUTING.md for details. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4437 +/- ##
=============================================
- Coverage 87.54% 70.55% -17.00%
Complexity 1608 1608
=============================================
Files 1300 1246 -54
Lines 241253 145869 -95384
Branches 201557 106173 -95384
=============================================
- Hits 211207 102914 -108293
- Misses 25014 38052 +13038
+ Partials 5032 4903 -129
🚀 New features to boost your workflow:
|
This was referenced Oct 8, 2026
Contributor
Author
|
Closing: #4506 and #4561 replaced the single-session send path this test exercised with partition lanes and per-replica links, and the multi-leader routing work is the fix for #4436, as noted on the issue. The test pins the old design, so it no longer applies. #4436 can be closed once you are happy the routing covers it. |
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.
Which issue does this PR address?
Relates to #4436
Rationale
New bugs should come with a failing test, so this PR adds only that test. The
fix belongs in the Rust SDK's send path, and is left for discussion.
What changed?
When two partitions of a topic have their primaries on different nodes, a
producer that alternates between them is refused (
TransientNotAccepted) onevery send. It waits out two 2s transient windows, then moves its only session to
another node. Each send takes about 4s. Polls avoid this through
PollRouter.Sends have no equivalent.
given_partitions_on_different_primaries_when_sending_round_robin_should_keep_the_sessionbuilds on the existing
seed_split_primariesfixture. Partition 0 keeps itsprimary through a metadata-only election. Partition 1, created afterwards with
create_partitions, is seeded onto the metadata leader. A precondition checksvia
GET_POLL_ROUTINGthat the two primaries are on different nodes. After onewarm-up send to each partition, the test alternates four sends and asserts that
none of them moves the session to another node. It is
#[ignore = "#4436: ..."], so default CI stays green, and it runs with--ignored.Local Execution
master@43fb44364, every time with4 of 4 sends moved it to another node ... [(0, 2, 0, 4.020694671s), (1, 0, 2, 4.018801233s), (0, 2, 0, 4.019829788s), (1, 0, 2, 4.018055753s)].On tag
iggy-0.11.0it fails the same way (about 4.07s per send).cargo fmt --all --checkandcargo clippy -p integration --all-features --tests -- -D warningsare clean.prek run --files <changed>ran. Everything that appliespassed (typos, whitespace, trailing newline, binary artifacts, skills) except
license-headers, which could not run becausejq/hawkeyeare notinstalled. The file already carries the ASF header and the diff does not
touch it. cargo fmt and clippy ran separately (see above).
#[ignore]reason. The file was checked withrustfmt --checkafter thatchange, but the test was not rerun.
AI Usage
path, and comparing it with
PollRouter), the test and the write-up.above. The client log confirms the mechanism: about 4s of refusals, then
trying the next cluster nodeorredirecting to leaderon every send. Thefixture asserts its precondition, that the partition primaries are on
different nodes, before any send, so it cannot fail for an unrelated reason.
🤖 Generated with Claude Code