arunsarin85 commented on code in PR #11212:
URL: https://github.com/apache/ozone/pull/11212#discussion_r3972245284
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/service/TestDirectoryDeletingServiceWithFSO.java:
##########
@@ -823,6 +827,27 @@ static void assertSubPathsCount(LongSupplier pathCount,
long expectedCount)
1000, 120000);
}
+ /**
+ * Wait until SnapshotDeletingService has purged snapshots and
snapshotInfoTable
+ * reaches the expected row count.
+ */
+ private void waitForSnapshotsPurged(Table<String, SnapshotInfo>
snapshotInfoTable,
+ int expectedCount) throws Exception {
+ SnapshotDeletingService snapshotDeletingService =
+ cluster.getOzoneManager().getKeyManager().getSnapshotDeletingService();
+ snapshotDeletingService.resume();
+ GenericTestUtils.waitFor(() -> {
+ try {
+ snapshotDeletingService.runPeriodicalTaskNow();
+ cluster.getOzoneManager().awaitDoubleBufferFlush();
+ return cluster.getOzoneManager().getMetadataManager()
+ .countRowsInTable(snapshotInfoTable) == expectedCount;
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to run SnapshotDeletingService
purge task", e);
+ }
+ }, 1000, 120000);
Review Comment:
runPeriodicalTaskNow() and background SDS waitForSnapshotsPurged is now just
two lines
--
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]