You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "mumrah (via GitHub)" <gi...@apache.org> on 2023/05/26 03:17:56 UTC

[GitHub] [kafka] mumrah commented on a diff in pull request #13758: KAFKA-15010 ZK migration failover support

mumrah commented on code in PR #13758:
URL: https://github.com/apache/kafka/pull/13758#discussion_r1206199732


##########
metadata/src/main/java/org/apache/kafka/metadata/migration/KRaftMigrationZkWriter.java:
##########
@@ -260,37 +293,37 @@ public void visitScramCredential(String userName, ScramMechanism scramMechanism,
         });
 
         changedNonUserEntities.forEach(entity -> {
-            Map<String, Double> quotaMap = clientQuotasImage.entities().get(entity).quotaMap();
-            operationConsumer.accept("Update client quotas for " + entity, migrationState ->
+            Map<String, Double> quotaMap = getClientQuotaMapForEntity(clientQuotasImage, entity);
+            opConsumer.accept(UPDATE_CLIENT_QUOTA, "Update client quotas for " + entity, migrationState ->
                 migrationClient.configClient().writeClientQuotas(entity.entries(), quotaMap, Collections.emptyMap(), migrationState));
         });
 
         changedUsers.forEach(userName -> {
             ClientQuotaEntity entity = new ClientQuotaEntity(Collections.singletonMap(ClientQuotaEntity.USER, userName));
-            Map<String, Double> quotaMap = clientQuotasImage.entities().get(entity).quotaMap();
+            Map<String, Double> quotaMap = getClientQuotaMapForEntity(clientQuotasImage, entity);

Review Comment:
   There was an NPE here prior to this patch. If the SCRAM credentials changed, but ClientQuotas did not, the `get(entity)` call would return a null.



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org