KKcorps commented on code in PR #15495:
URL: https://github.com/apache/pinot/pull/15495#discussion_r2036418450
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java:
##########
@@ -2573,66 +2573,37 @@ public Set<String> getSegmentsYetToBeCommitted(String
tableNameWithType, Set<Str
* @param committingSegments List of new segment names that are currently in
COMMITTING state.
* If null, returns true without making any changes
to the existing list
* @return true if the synchronization succeeds, false if there's a failure
in updating ZooKeeper
- * @see #getCommittingSegments for the logic that filters out segments no
longer in COMMITTING state
*/
- public boolean syncCommittingSegments(String realtimeTableName, @NotNull
List<String> committingSegments) {
+ public boolean syncCommittingSegments(String realtimeTableName, List<String>
committingSegments) {
+ String pauselessDebugMetadataPath =
+
ZKMetadataProvider.constructPropertyStorePathForPauselessDebugMetadata(realtimeTableName);
return updateCommittingSegmentsList(realtimeTableName, () -> {
- String committingSegmentsListPath =
-
ZKMetadataProvider.constructPropertyStorePathForPauselessDebugMetadata(realtimeTableName);
-
// Fetch the committing segments record from the property store.
Stat stat = new Stat();
- ZNRecord znRecord = _propertyStore.get(committingSegmentsListPath, stat,
AccessOption.PERSISTENT);
+ ZNRecord znRecord = _propertyStore.get(pauselessDebugMetadataPath, stat,
AccessOption.PERSISTENT);
- // empty ZN record for the table
+ // Create ZN record if it doesn't exist
if (znRecord == null) {
znRecord = new ZNRecord(realtimeTableName);
znRecord.setListField(COMMITTING_SEGMENTS, committingSegments);
- return _propertyStore.create(committingSegmentsListPath, znRecord,
AccessOption.PERSISTENT);
+ return _propertyStore.create(pauselessDebugMetadataPath, znRecord,
AccessOption.PERSISTENT);
}
- Set<String> mergedSegments = new HashSet<>(committingSegments);
- // Get segments that are present in the list and are still in COMMITTING
status
- List<String> existingSegments =
- getCommittingSegments(realtimeTableName,
znRecord.getListField(COMMITTING_SEGMENTS));
- if (existingSegments != null) {
- mergedSegments.addAll(existingSegments);
+ // Check ZK metadata again to get the latest list of committing segments
+ List<String> committingSegmentsFromPropertyStore =
znRecord.getListField(COMMITTING_SEGMENTS);
Review Comment:
nit: maybe we can call it `commitSegmentsSnapshot`
--
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]