brandboat commented on code in PR #21396:
URL: https://github.com/apache/kafka/pull/21396#discussion_r2777628373
##########
clients/clients-integration-tests/src/test/java/org/apache/kafka/clients/consumer/ConsumerIntegrationTest.java:
##########
@@ -335,6 +343,50 @@ public void testRackAwareAssignment(ClusterInstance
clusterInstance) throws Exec
}
}
+ @SuppressWarnings("unchecked")
+ @ClusterTest(
+ brokers = 2,
+ types = {Type.KRAFT},
+ serverProperties = {
+ @ClusterConfigProperty(key =
GroupCoordinatorConfig.OFFSETS_TOPIC_PARTITIONS_CONFIG, value = "1"),
+ @ClusterConfigProperty(key =
GroupCoordinatorConfig.GROUP_COORDINATOR_APPEND_LINGER_MS_CONFIG, value =
"3000")
+ }
+ )
+ public void
testSingleCoordinatorOwnershipAfterPartitionReassignment(ClusterInstance
clusterInstance) throws InterruptedException, ExecutionException,
TimeoutException {
Review Comment:
Yes, the coordinator shard is always removed like you mentioned.
But the purpose of this test is to ensure that `coordinator.onUnloaded()` is
triggered correctly. Even though the coordinator shard is removed in the
finally block of scheduleUnloadOperation, that does not guarantee that
`coordinator.onUnloaded()` is invoked, which means the
[shard](https://github.com/apache/kafka/blob/815dd93e2f9936bb9a2b738b67b94e270ab0e48a/group-coordinator/src/main/java/org/apache/kafka/coordinator/group/metrics/GroupCoordinatorMetrics.java#L109)
in GroupCoordinatorMetrics is not removed (GroupCoordinatorMetrics still hold
the CoordinatorMetricsShard reference) if failCurrentBatch throw error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]