Copilot commented on code in PR #12088:
URL: https://github.com/apache/ozone/pull/12088#discussion_r4624133826


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/KeyLifecycleService.java:
##########
@@ -687,10 +732,7 @@ private void evaluateKeyAndDirTable(OmBucketInfo bucket, 
long volumeObjId, Table
 
       HashSet<Long> deletedDirSet = new HashSet<>();
       while (!stack.isEmpty()) {
-        if (!shouldRun()) {
-          scanAborted = true;
-          LOG.info("KeyLifecycleService is suspended, disabled, leader not 
ready, or about to restart. " +
-              "Stopping task for bucket {}.", bucketName);
+        if (!shouldContinue(bucketName)) {

Review Comment:
   `shouldContinue()` is checked only between FSO directories; neither the 
per-directory cache loop nor the key-table loop honors a policy change detected 
during a flush. A directory with millions of files can therefore keep the old 
task in `inFlight` and delay the updated policy until the directory finishes 
scanning. Add cancellation checks to both inner loops so they return promptly 
once the change is detected.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/KeyLifecycleService.java:
##########
@@ -1413,7 +1470,7 @@ private void handleAndClearFullList(OmBucketInfo bucket, 
LimitedExpiredObjectLis
     }
 
     private void sendSaveScanStateRequest(OmLifecycleScanState.Builder 
scanStateBuilder, boolean scanFinished) {
-      if (scanStateBuilder != null) {
+      if (scanStateBuilder != null && !checkPolicyChange()) {

Review Comment:
   `deleteDirsAndClearList()` submits `DeleteKey` requests before reaching this 
policy check, so expired FSO directories can still be deleted after the 
configuration is removed or updated—even if another path has already detected 
the change. Check the policy in the directory-deletion loop after the pause 
injector, and clear the pending list before returning when it changes.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/KeyLifecycleService.java:
##########
@@ -1311,6 +1364,10 @@ private void 
abortExpiredMultipartUploadsAndClear(OmBucketInfo bucketInfo,
       if (expiredUploads.isEmpty()) {
         return;
       }
+      if (checkPolicyChange()) {

Review Comment:
   `abortExpiredMultipartUploadsAndClear()` still clears its list after a 
failed abort because `abortExpiredMultipartUploads()` only logs failures. The 
new checkpoint can then save a cursor past uploads that remain, so an 
interrupted scan skips them on resume. Propagate abort failures to `call()` 
before clearing the list or saving state, so the next task retries from the 
previous checkpoint.



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