ChenSammi commented on code in PR #11344:
URL: https://github.com/apache/ozone/pull/11344#discussion_r4142011388
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/lifecycle/OMLifecycleConfigurationSetRequest.java:
##########
@@ -235,15 +235,22 @@ private static void
validateAbortMpuDaysAgainstCleanupThreshold(
String expireThresholdConfig = ozoneManager.getConfiguration().get(
OMConfigKeys.OZONE_OM_MPU_EXPIRE_THRESHOLD,
OMConfigKeys.OZONE_OM_MPU_EXPIRE_THRESHOLD_DEFAULT);
+ long maxEffectiveDays = (expireThresholdMillis - 1) /
TimeUnit.DAYS.toMillis(1);
+ String remediation = maxEffectiveDays >= 1
+ ? "Set daysAfterInitiation to " + maxEffectiveDays + " day(s)
or fewer, or increase "
+ + OMConfigKeys.OZONE_OM_MPU_EXPIRE_THRESHOLD + "."
+ : "DaysAfterInitiation can only be configured in whole days,
so no value satisfies the "
+ + "current threshold. Increase " +
OMConfigKeys.OZONE_OM_MPU_EXPIRE_THRESHOLD
+ + " to more than 1 day to use this rule.";
throw new OMException(
"Invalid lifecycle configuration: rule '" + rule.getId() + "'
has an " +
"AbortIncompleteMultipartUpload action with
daysAfterInitiation=" + daysAfterInitiation +
- " day(s), which is not less than the cluster MPU expire
threshold (" +
- OMConfigKeys.OZONE_OM_MPU_EXPIRE_THRESHOLD + "=" +
expireThresholdConfig +
- "). The MultipartUploadCleanupService will clean up the upload
before the " +
- "lifecycle rule fires, making the rule ineffective. " +
- "Set daysAfterInitiation to a value less than " +
expireThresholdConfig +
Review Comment:
Make sure daysAfterInitiation time duration is shorter than
OMConfigKeys.OZONE_OM_MPU_EXPIRE_THRESHOLD.
This is good enough.
--
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]