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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/KeyLifecycleService.java:
##########
@@ -1106,10 +1142,7 @@ private void processMultipartUploads(OmBucketInfo 
bucketInfo, List<OmLCRule> rul
       try (TableIterator<String, ? extends Table.KeyValue<String, 
OmMultipartKeyInfo>> mpuIterator =
                
omMetadataManager.getMultipartInfoTable().iterator(bucketPrefix)) {
         while (mpuIterator.hasNext()) {
-          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()` only reads the cached `policyChanged` flag, and multipart 
scanning has no periodic configuration check unless an expired-upload batch is 
flushed. With an MPU-only policy and nonmatching uploads, a policy update or 
deletion goes unnoticed throughout the scan, delaying scheduling of the updated 
policy. Recheck the configuration periodically during iteration, including when 
uploads do not match any rule.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/KeyLifecycleService.java:
##########
@@ -686,10 +728,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:
   This guard runs only between directories: the inner FSO cache and key-table 
loops keep scanning even after a batch flush or state save sets 
`policyChanged`. A directory with millions of files therefore keeps the old 
task in flight and delays scheduling the updated policy. Add 
`shouldContinue(bucketName)` checks inside both file-iteration loops (lines 875 
and 912), returning when the task should stop.



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