ChenSammi commented on code in PR #10982:
URL: https://github.com/apache/ozone/pull/10982#discussion_r3764112665


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/lifecycle/OMLifecycleConfigurationSetRequest.java:
##########
@@ -203,6 +209,46 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager, Execut
     }
   }
 
+  /**
+   * Rejects lifecycle configurations where an AbortIncompleteMultipartUpload 
rule's
+   * daysAfterInitiation is greater than or equal to the cluster-wide MPU 
expire threshold
+   * (ozone.om.open.mpu.expire.threshold). When that happens, 
MultipartUploadCleanupService
+   * will reap the upload before the lifecycle rule ever fires, silently 
making the rule
+   * ineffective. Failing fast here surfaces the misconfiguration to the 
operator.
+   */
+  private static void validateAbortMpuDaysAgainstCleanupThreshold(
+      OzoneManager ozoneManager, LifecycleConfiguration config) throws 
OMException {
+    long expireThresholdMillis = 
ozoneManager.getConfiguration().getTimeDuration(
+        OMConfigKeys.OZONE_OM_MPU_EXPIRE_THRESHOLD,
+        OMConfigKeys.OZONE_OM_MPU_EXPIRE_THRESHOLD_DEFAULT,
+        TimeUnit.MILLISECONDS);
+    long expireThresholdDays = 
TimeUnit.MILLISECONDS.toDays(expireThresholdMillis);
+
+    for (LifecycleRule rule : config.getRulesList()) {

Review Comment:
   We can skip disabled rule, only evaluate enabled rule.



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