Jackie-Jiang commented on code in PR #18716:
URL: https://github.com/apache/pinot/pull/18716#discussion_r3448929365


##########
pinot-tools/src/main/java/org/apache/pinot/tools/PinotNumReplicaChanger.java:
##########
@@ -89,6 +89,9 @@ private IdealState updateIdealState(IdealState idealState, 
int newNumReplicas) {
     Set<String> segmentIds = idealState.getPartitionSet();
     for (String segmentId : segmentIds) {
       Map<String, String> instanceStateMap = 
idealState.getInstanceStateMap(segmentId);
+      if (instanceStateMap == null) {

Review Comment:
   We don't really handle corrupted ideal state. If that happens, we will 
encounter error everywhere.
   
   One potential optimization here is to directly loop over 
`idealState.getRecord().getMapFields()` to avoid per entry map lookup



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to