C0urante commented on code in PR #16767:
URL: https://github.com/apache/kafka/pull/16767#discussion_r1704181525


##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorCheckpointConnector.java:
##########
@@ -136,10 +137,14 @@ public List<Map<String, String>> taskConfigs(int 
maxTasks) {
         // if the replication is disabled, known consumer group is empty, or 
checkpoint emission is
         // disabled by setting 'emit.checkpoints.enabled' to false, the 
interval of checkpoint emission
         // will be negative and no 'MirrorCheckpointTask' will be created
-        if (!config.enabled() || knownConsumerGroups.isEmpty()
-                || config.emitCheckpointsInterval().isNegative()) {
+        if (!config.enabled() || 
config.emitCheckpointsInterval().isNegative()) {
             return Collections.emptyList();
+        } else if (knownConsumerGroups.isEmpty()) {

Review Comment:
   If there are no consumer groups on the source cluster, or at least no 
consumer groups that should be replicated, won't this condition still be 
triggered?
   
   It's a little dirty and would require some changes to prevent NPEs, but I'm 
wondering if we can distinguish between "We haven't finished the initial load 
of consumer groups yet" and "We've finished the initial load but there aren't 
any consumer groups to replicate" by using `knownConsumerGroups = null` in the 
first case and `knownConsumerGroups = Collections.emptySet()` (or some 
equivalent empty value) in the second.
   
   Thoughts?



-- 
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]

Reply via email to