jackjlli commented on code in PR #8838:
URL: https://github.com/apache/pinot/pull/8838#discussion_r891677547
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -3183,6 +3186,20 @@ public String startReplaceSegments(String
tableNameWithType, List<String> segmen
return segmentLineageEntryId;
}
+ private void waitForSegmentsToDelete(String tableNameWithType, List<String>
segments, long timeOutInMillis)
+ throws InterruptedException {
+ LOGGER.info("Wait segments to delete. timeout = {}ms, segments = {}",
timeOutInMillis, segments);
Review Comment:
`LOGGER.info("Waiting for {} segments to delete for table: {}. timeout =
{}ms, segments = {}", segments.size(), tableNameWithType, timeOutInMillis,
segments)`
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -3183,6 +3186,20 @@ public String startReplaceSegments(String
tableNameWithType, List<String> segmen
return segmentLineageEntryId;
}
+ private void waitForSegmentsToDelete(String tableNameWithType, List<String>
segments, long timeOutInMillis)
+ throws InterruptedException {
+ LOGGER.info("Wait segments to delete. timeout = {}ms, segments = {}",
timeOutInMillis, segments);
+ long endTimeMs = System.currentTimeMillis() + timeOutInMillis;
+ do {
+ if (Collections.disjoint(getSegmentsFor(tableNameWithType, false),
segments)) {
+ return;
+ } else {
+ Thread.sleep(SEGMENT_CLEANUP_CHECK_INTERVAL_MS);
+ }
+ } while (System.currentTimeMillis() < endTimeMs);
+ throw new RuntimeException("Timeout while waiting for segments to be
deleted");
Review Comment:
Also, suggest adding some details of the exception in Line 3176 to briefly
explain why the request failed.
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java:
##########
@@ -3183,6 +3186,20 @@ public String startReplaceSegments(String
tableNameWithType, List<String> segmen
return segmentLineageEntryId;
}
+ private void waitForSegmentsToDelete(String tableNameWithType, List<String>
segments, long timeOutInMillis)
+ throws InterruptedException {
+ LOGGER.info("Wait segments to delete. timeout = {}ms, segments = {}",
timeOutInMillis, segments);
+ long endTimeMs = System.currentTimeMillis() + timeOutInMillis;
+ do {
+ if (Collections.disjoint(getSegmentsFor(tableNameWithType, false),
segments)) {
+ return;
+ } else {
+ Thread.sleep(SEGMENT_CLEANUP_CHECK_INTERVAL_MS);
+ }
+ } while (System.currentTimeMillis() < endTimeMs);
+ throw new RuntimeException("Timeout while waiting for segments to be
deleted");
Review Comment:
log the table name and the timeout value here.
--
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]