klsince commented on code in PR #14447: URL: https://github.com/apache/pinot/pull/14447#discussion_r1842698258
########## pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/UpsertTableSegmentPreloadIntegrationTest.java: ########## @@ -207,19 +208,24 @@ public void testSegmentAssignment() protected void waitForSnapshotCreation() throws Exception { - // Trigger force commit so that snapshots are created + // Pause consumption and wait until all consuming segments are committed and loaded as immutable segment String rawTableName = getTableName(); - sendPostRequest(_controllerRequestURLBuilder.forTableForceCommit(rawTableName), null); - - // All the uploaded segments should have snapshots generated. There is no guarantee that the just committed segments - // have snapshots generated because when the snapshot is taken, the committed segment might not be replaced with the - // immutable segment yet. + sendPostRequest(_controllerRequestURLBuilder.forPauseConsumption(rawTableName)); + TestUtils.waitForCondition(aVoid -> { + ExecutionStats executionStats = + getPinotConnection().execute("SELECT COUNT(*) FROM " + rawTableName).getExecutionStats(); + return executionStats.getNumSegmentsQueried() == 5 && executionStats.getNumConsumingSegmentsQueried() == 0; + }, 600_000L, "Failed to pause consumption"); + // Resume consumption to trigger snapshot + sendPostRequest(_controllerRequestURLBuilder.forResumeConsumption(rawTableName)); Review Comment: nice trick to pause/resume to make all segment immutable for snapshotting -- 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