ChenSammi commented on code in PR #10982:
URL: https://github.com/apache/ozone/pull/10982#discussion_r3764105122
##########
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);
Review Comment:
toDays() do the truncate, so if MPU expiration threshold is 36h, it will
truncate to 1 day. Compare in milliseconds will not have this issue.
--
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]