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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org