MINOR: Add more stickiness tests for server-side assignors - #23155
Open
squah-confluent wants to merge 1 commit into
Open
MINOR: Add more stickiness tests for server-side assignors#23155squah-confluent wants to merge 1 commit into
squah-confluent wants to merge 1 commit into
Conversation
Previously we added tests for assignor stability under different member iteration orders. We are also interested in stability when static members are replaced and stickiness when members are replaced. Add tests for both, across all server-side assignors.
squah-confluent
commented
Aug 13, 2026
Comment on lines
+89
to
99
| @Disabled("RangeAssignor is not currently sticky when members are replaced.") | ||
| @ParameterizedTest | ||
| @CsvSource({ | ||
| "HOMOGENEOUS, false", | ||
| "HOMOGENEOUS, true", | ||
| "HETEROGENEOUS, false", | ||
| "HETEROGENEOUS, true" | ||
| }) | ||
| public void testMemberReplacementStickiness(SubscriptionType subscriptionType, boolean rackAware) { | ||
| CommonAssignorTests.testMemberReplacementStickiness(assignor, subscriptionType, rackAware); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
The RangeAssignor is not sticky when members are added or removed, so this test fails.
squah-confluent
commented
Aug 13, 2026
Comment on lines
+219
to
+233
| /** | ||
| * Tests that an assignor maintains stickiness when member ids are swapped around. | ||
| * An assignor that passes this test will likely maintain stickiness when a single member is | ||
| * removed and replaced with a new member and generally during scale up and scale down, as | ||
| * members are added and removed. | ||
| * | ||
| * @param assignor The assignor. | ||
| * @param subscriptionType The subscription type. | ||
| * @param rackAware Whether to test with rack awareness. | ||
| */ | ||
| public static void testMemberReplacementStickiness( | ||
| PartitionAssignor assignor, | ||
| SubscriptionType subscriptionType, | ||
| boolean rackAware | ||
| ) { |
Contributor
Author
There was a problem hiding this comment.
I thought about adding a re-usable stickiness test for new members but it's not easy to make a generic test. The minimal set of partitions that can be taken from existing members depends on the assignor. For the range assignor, the re-assigned partitions must have the same indices for example.
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.
Previously we added tests for assignor stability under different member
iteration orders. We are also interested in stability when static
members are replaced and stickiness when members are replaced. Add tests
for both, across all server-side assignors.