Aravind-Suresh commented on code in PR #11183:
URL: https://github.com/apache/pinot/pull/11183#discussion_r1281278417


##########
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/HelixInstanceDataManager.java:
##########
@@ -242,6 +242,30 @@ public void addRealtimeSegment(String realtimeTableName, 
String segmentName)
     LOGGER.info("Added segment: {} to table: {}", segmentName, 
realtimeTableName);
   }
 
+  private void snapshotAndAddSegments(TableDataManager tableDataManager, 
String realtimeTableName)
+      throws Exception {
+    // we need to do an atomic snapshot here and then add segments because

Review Comment:
   That particular race condition is avoided because this logic is put inside 
_tableDataManagerMap.compute method which ends up locking the corresponding 
hashNode until the logic completes.
   
   Have seen similar patterns in other functions of the code -- so I maintained 
the same.
   
   I'll try to clarify it in an in-code comment -- let me know if I'm missing 
something.



-- 
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: commits-unsubscr...@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to