CalvinConfluent commented on code in PR #15702:
URL: https://github.com/apache/kafka/pull/15702#discussion_r1583424779


##########
metadata/src/main/java/org/apache/kafka/controller/ConfigurationControlManager.java:
##########
@@ -308,6 +328,48 @@ private ApiError validateAlterConfig(ConfigResource 
configResource,
         return ApiError.NONE;
     }
 
+    void maybeTriggerPartitionUpdateOnMinIsrChange(List<ApiMessageAndVersion> 
records) {
+        List<ConfigRecord> minIsrRecords = new ArrayList<>();
+        Map<String, String> topicMap = new HashMap<>();
+        Map<String, String> configRemovedTopicMap = new HashMap<>();
+        records.forEach(record -> {
+            if (MetadataRecordType.fromId(record.message().apiKey()) == 
MetadataRecordType.CONFIG_RECORD) {
+                ConfigRecord configRecord = (ConfigRecord) record.message();
+                if 
(configRecord.name().equals(TopicConfig.MIN_IN_SYNC_REPLICAS_CONFIG)) {
+                    minIsrRecords.add(configRecord);
+                    if (Type.forId(configRecord.resourceType()) == Type.TOPIC) 
{
+                        if (configRecord.value() == null) 
topicMap.put(configRecord.resourceName(), configRecord.value());
+                        else 
configRemovedTopicMap.put(configRecord.resourceName(), configRecord.value());
+                    }
+                }
+            }
+        });

Review Comment:
   If `min.insync.replicas` is not set on the topic config level, the effective 
`min.insync.replicas` of a topic will change if default broker config is 
updated.



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

Reply via email to