ashishkumar50 commented on code in PR #7486:
URL: https://github.com/apache/ozone/pull/7486#discussion_r1901569725


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestKeyPurging.java:
##########
@@ -140,7 +140,7 @@ public void testKeysPurgingByKeyDeletingService() throws 
Exception {
     GenericTestUtils.waitFor(
         () -> {
           try {
-            return keyManager.getPendingDeletionKeys(Integer.MAX_VALUE)
+            return keyManager.getPendingDeletionKeys(Integer.MAX_VALUE, 
keyDeletingService.getDeletedKeySupplier())

Review Comment:
   Tests will fail because now same iterator is used by background service and 
test code. Need to make sure only one is running at a time to get correct 
result.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/KeyDeletingService.java:
##########
@@ -140,10 +153,57 @@ public boolean isRunningOnAOS() {
   @Override
   public BackgroundTaskQueue getTasks() {
     BackgroundTaskQueue queue = new BackgroundTaskQueue();
-    queue.add(new KeyDeletingTask(this));
+    if (taskCount.get() > 0) {
+      LOG.info("{} Key deleting task(s) already in progress.",
+          taskCount.get());
+      return queue;
+    }
+    try {
+      deletedKeySupplier.reInitItr();
+    } catch (IOException ex) {
+      LOG.error("Unable to get the iterator.", ex);

Review Comment:
   Return from here if there is an exception, no point in continuing.



-- 
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]

Reply via email to