Skip to content

MINOR: Add more stickiness tests for server-side assignors - #23155

Open
squah-confluent wants to merge 1 commit into
apache:trunkfrom
confluentinc:squah-test-more-assignor-stickiness
Open

MINOR: Add more stickiness tests for server-side assignors#23155
squah-confluent wants to merge 1 commit into
apache:trunkfrom
confluentinc:squah-test-more-assignor-stickiness

Conversation

@squah-confluent

@squah-confluent squah-confluent commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

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.

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.
@github-actions github-actions Bot added triage PRs from the community tests Test fixes (including flaky tests) group-coordinator labels 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);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RangeAssignor is not sticky when members are added or removed, so this test fails.

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
) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

group-coordinator tests Test fixes (including flaky tests) triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant