chia7712 commented on code in PR #15999: URL: https://github.com/apache/kafka/pull/15999#discussion_r1668806360
########## connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorCheckpointConfig.java: ########## @@ -166,6 +167,30 @@ Duration consumerPollTimeout() { return Duration.ofMillis(getLong(CONSUMER_POLL_TIMEOUT_MILLIS)); } + public static Map<String, String> validate(Map<String, String> configs) { + Map<String, String> invalidConfigs = new HashMap<>(); + + // No point to validate when connector is disabled. + if ("false".equals(configs.getOrDefault(ENABLED, "true"))) { + return invalidConfigs; + } + + boolean emitCheckpointDisabled = "false".equals(configs.getOrDefault(EMIT_CHECKPOINTS_ENABLED, "true")); + boolean syncGroupOffsetsDisabled = "false".equals(configs.getOrDefault(SYNC_GROUP_OFFSETS_ENABLED, "true")); + + if (emitCheckpointDisabled && syncGroupOffsetsDisabled) { + Arrays.asList(SYNC_GROUP_OFFSETS_ENABLED, EMIT_CHECKPOINTS_ENABLED).forEach(configName -> { + invalidConfigs.putIfAbsent(configName, "MirrorCheckpointConnector can't run with both " + SYNC_GROUP_OFFSETS_ENABLED + " and " + Review Comment: > It seems to me EMIT_CHECKPOINTS_ENABLED does not obstruct MirrorCheckpointConnector from running since it is used to update consumer groups offsets of target cluster. By contrast, SYNC_GROUP_OFFSETS_ENABLED do impact the MirrorCheckpointConnector I just notice that I use the incorrect config name :( > My understanding that it will not start a task so the connector would be doing nothing without any feedback or indication for why. agree and my point was "we should return invalid config if `EMIT_CHECKPOINTS_ENABLED=false`", because `SYNC_GROUP_OFFSETS_ENABLED=false` is allowed to `MirrorCheckpointConnector` . For example: in this case: `EMIT_CHECKPOINTS_ENABLED=false` and `SYNC_GROUP_OFFSETS_ENABLED=true` we should return invalid configs, right? -- 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