sumitagrawl commented on code in PR #7035:
URL: https://github.com/apache/ozone/pull/7035#discussion_r1716686110
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/upgrade/QuotaRepairUpgradeAction.java:
##########
@@ -21,26 +21,36 @@
import org.apache.hadoop.ozone.om.OMConfigKeys;
import org.apache.hadoop.ozone.om.OzoneManager;
+import org.apache.hadoop.ozone.om.exceptions.OMLeaderNotReadyException;
+import org.apache.hadoop.ozone.om.exceptions.OMNotLeaderException;
import org.apache.hadoop.ozone.om.service.QuotaRepairTask;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import static org.apache.hadoop.ozone.om.upgrade.OMLayoutFeature.QUOTA;
-import static
org.apache.hadoop.ozone.upgrade.LayoutFeature.UpgradeActionType.ON_FIRST_UPGRADE_START;
+import static
org.apache.hadoop.ozone.upgrade.LayoutFeature.UpgradeActionType.ON_FINALIZE;
/**
- * Quota repair for usages action to be triggered during first upgrade.
+ * Quota repair for usages action to be triggered after upgrade.
*/
-@UpgradeActionOm(type = ON_FIRST_UPGRADE_START, feature =
- QUOTA)
+@UpgradeActionOm(type = ON_FINALIZE, feature = QUOTA)
public class QuotaRepairUpgradeAction implements OmUpgradeAction {
+ private static final Logger LOG =
LoggerFactory.getLogger(QuotaRepairUpgradeAction.class);
@Override
public void execute(OzoneManager arg) throws Exception {
boolean enabled = arg.getConfiguration().getBoolean(
OMConfigKeys.OZONE_OM_UPGRADE_QUOTA_RECALCULATE_ENABLE,
OMConfigKeys.OZONE_OM_UPGRADE_QUOTA_RECALCULATE_ENABLE_DEFAULT);
if (enabled) {
- QuotaRepairTask quotaRepairTask = new QuotaRepairTask(
- arg.getMetadataManager());
- quotaRepairTask.repair();
+ // just trigger quota repair and status can be checked via CLI
+ try {
+ arg.checkLeaderStatus();
+ QuotaRepairTask quotaRepairTask = new QuotaRepairTask(arg);
+ quotaRepairTask.repair();
+ } catch (OMNotLeaderException | OMLeaderNotReadyException ex) {
Review Comment:
This might not be required as available for upgrade to 7.1.9 as one time
activity, present as was earlier there, need go with CLI tool instead.
--
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]