9aman commented on code in PR #15016:
URL: https://github.com/apache/pinot/pull/15016#discussion_r1950702672


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java:
##########
@@ -437,6 +441,56 @@ void persistSegmentZKMetadata(String realtimeTableName, 
SegmentZKMetadata segmen
     }
   }
 
+  private boolean addSegmentToCommittingSegmentsList(String realtimeTableName, 
String segmentName) {
+    String committingSegmentsListPath =
+        
ZKMetadataProvider.constructPropertyStorePathForPauselessDebugMetadata(realtimeTableName);
+    Stat stat = new Stat();
+    ZNRecord znRecord = _propertyStore.get(committingSegmentsListPath, stat, 
AccessOption.PERSISTENT);
+    int expectedVersion = stat.getVersion();
+
+    // empty ZN record for the table
+    if (znRecord == null) {
+      znRecord = new ZNRecord(realtimeTableName);
+      znRecord.setListField(COMMITTING_SEGMENTS, List.of(segmentName));
+      return _propertyStore.create(committingSegmentsListPath, znRecord, 
AccessOption.PERSISTENT);
+    }
+
+    // segment already present in the list
+    List<String> committingSegmentList = 
znRecord.getListField(COMMITTING_SEGMENTS);

Review Comment:
   Added it for both addition and removal. I think we need to add metrics here. 
That would be really useful. 
   



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