adixitconfluent commented on code in PR #19659: URL: https://github.com/apache/kafka/pull/19659#discussion_r2084058088
########## core/src/main/java/kafka/server/share/SharePartitionManager.java: ########## @@ -746,6 +747,29 @@ private Consumer<Set<String>> failedShareAcknowledgeMetricsHandler() { }; } + /** + * The handler for share version feature metadata changes. + * @param shareVersion the new share version feature + */ + public void onShareVersionToggle(ShareVersion shareVersion) { + if (!shareVersion.supportsShareGroups()) { + // Remove all share sessions from share session cache. + synchronized (cache) { Review Comment: Agreed. To tackle this, I have added an attribute `AtomicBoolean isShareGroupsSupported` to `SharePartitionManager`. Whenever, the feature is toggled, we can set this value to `isShareGroupsSupported`. Using this value, we can control entry to `cache.maybeCreateSession` and `cache.updateNumPartitions(shareSession)` -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org