snleee commented on a change in pull request #5782: URL: https://github.com/apache/incubator-pinot/pull/5782#discussion_r465575287
########## File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java ########## @@ -2344,14 +2361,35 @@ public void endReplaceSegments(String tableNameWithType, String segmentLineageEn return true; } + // Check that all the segments from 'segmentsTo' exist in the table + Set<String> segmentsForTable = new HashSet<>(getSegmentsFor(tableNameWithType)); + Preconditions.checkArgument(segmentsForTable.containsAll(lineageEntry.getSegmentsTo()), String.format( + "Not all segments from 'segmentsTo' are available in the table. (tableName = '%s', segmentsTo = '%s', " + + "segmentsFromTable = '%s')", tableNameWithType, lineageEntry.getSegmentsTo(), segmentsForTable)); + + // Check that all the segments from 'segmentsTo' became ONLINE in the external view + Set<String> onlineSegmentsFromEV = getOnlineSegmentsFromExternalView(tableNameWithType); + Preconditions.checkArgument(onlineSegmentsFromEV.containsAll(lineageEntry.getSegmentsTo()), String.format( Review comment: this makes sense. I changed it ---------------------------------------------------------------- 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. 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