chia7712 commented on code in PR #17796:
URL: https://github.com/apache/kafka/pull/17796#discussion_r1863901810
##########
core/src/main/java/kafka/server/share/SharePartitionManager.java:
##########
@@ -609,6 +610,12 @@ private SharePartition
getOrCreateSharePartition(SharePartitionKey sharePartitio
k -> {
long start = time.hiResClockMs();
int leaderEpoch =
ShareFetchUtils.leaderEpoch(replicaManager,
sharePartitionKey.topicIdPartition().topicPartition());
+ // Attach listener to Partition which shall invoke
partition change handlers.
+ // However, as there could be multiple share partitions
(per group name) for a single topic-partition,
+ // hence create separate listeners per share partition
which holds the share partition key
+ // to identify the respective share partition.
+
replicaManager.maybeAddListener(sharePartitionKey.topicIdPartition().topicPartition(),
Review Comment:
Do we have a mechanism to remove unused listeners? Since a listener is
created for each group, the list of listeners in a partition could grow
significantly over time. Especially considering that the listener includes a
hot method `onHighWatermarkUpdated`
--
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]