You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "sarvekshayr (via GitHub)" <gi...@apache.org> on 2025/01/08 06:40:53 UTC
[PR] HDDS-12039. Enhancements to ozone repair om commands [ozone]
sarvekshayr opened a new pull request, #7662:
URL: https://github.com/apache/ozone/pull/7662
## What changes were proposed in this pull request?
`ozone repair om`
These commands make repairs to an individual OM instance.
- `ozone repair om quota`
The new location of `ozone repair quota` which is an online command (requires running OM).
- Add [HDDS-11727](https://issues.apache.org/jira/browse/HDDS-11727) check to see if OM is running in`ozone repair om snapshot chain` and `ozone repair om update-transaction`.
## What is the link to the Apache JIRA
[HDDS-12039](https://issues.apache.org/jira/browse/HDDS-12039)
## How was this patch tested?
Tested the patch on a docker cluster.
```
bash-5.1$ ozone repair om
ATTENTION: Running as user hadoop. Make sure this is the same user used to run the Ozone process. Are you sure you want to continue (y/N)? y
Run as user: hadoop
Missing required subcommand
Usage: ozone repair om [COMMAND]
Operational tool to repair OM.
Commands:
fso-tree Identify and repair a disconnected FSO tree by marking
unreferenced entries for deletion. OM should be stopped
while this tool is run.
snapshot Subcommand for all snapshot related repairs.
update-transaction CLI to update the highest index in transactionInfoTable.
Currently it is only supported for OM.
quota Operational tool to repair quota in OM DB.
```
```
bash-5.1$ ozone repair om quota
ATTENTION: Running as user hadoop. Make sure this is the same user used to run the Ozone process. Are you sure you want to continue (y/N)? y
Run as user: hadoop
Missing required subcommand
Usage: ozone repair om quota [COMMAND]
Operational tool to repair quota in OM DB.
Commands:
status CLI to get the status of last trigger quota repair if available.
start CLI to trigger quota repair.
```
```
bash-5.1$ ozone repair om update-transaction --db /data/metadata/om.db --term 2 --index 2
ATTENTION: Running as user hadoop. Make sure this is the same user used to run the Ozone process. Are you sure you want to continue (y/N)? y
Run as user: hadoop
Error: OM is currently running on this host with PID 7. Stop the service before running the repair tool.
```
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-12039. Enhancements to ozone repair om commands [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #7662:
URL: https://github.com/apache/ozone/pull/7662#discussion_r1907460076
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/quota/QuotaStatus.java:
##########
@@ -35,7 +35,7 @@
mixinStandardHelpOptions = true,
versionProvider = HddsVersionProvider.class
)
-public class QuotaStatus implements Callable<Void> {
+public class QuotaStatus extends RepairTool {
Review Comment:
`QuotaStatus` just queries status, so the common repair steps (ask for confirmation, ensure `--dry-run` flag, etc.) do not apply. I don't think it should extend `RepairTool` (but it can extend `AbstractSubcommand` if needed).
`info()` will not be available, but `out()` and `err()` will be after HDDS-12002. Until then, we can leave usage of `System.(out|err)` as is.
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/quota/QuotaRepair.java:
##########
@@ -93,7 +86,7 @@ private String getTheOnlyConfiguredOmServiceIdOrThrow() {
}
private Collection<String> getConfiguredServiceIds() {
- OzoneConfiguration conf = parent.getOzoneConf();
+ OzoneConfiguration conf = new OzoneConfiguration();
Review Comment:
```suggestion
OzoneConfiguration conf = getOzoneConf();
```
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/quota/QuotaRepair.java:
##########
@@ -48,18 +45,14 @@
QuotaTrigger.class,
},
description = "Operational tool to repair quota in OM DB.")
-@MetaInfServices(RepairSubcommand.class)
-public class QuotaRepair implements RepairSubcommand {
-
- @CommandLine.ParentCommand
- private OzoneRepair parent;
+public class QuotaRepair {
Review Comment:
```suggestion
public class QuotaRepair extends AbstractSubcommand {
```
(needs import, too)
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneRepairShell.java:
##########
@@ -128,14 +128,14 @@ private String[] parseScanOutput(String output) {
public void testQuotaRepair() throws Exception {
CommandLine cmd = new OzoneRepair().getCmd();
- int exitCode = cmd.execute("quota", "status", "--service-host", conf.get(OZONE_OM_ADDRESS_KEY));
+ int exitCode = cmd.execute("om", "quota", "status", "--service-host", conf.get(OZONE_OM_ADDRESS_KEY));
assertEquals(0, exitCode, err);
- exitCode = cmd.execute("quota", "start", "--service-host", conf.get(OZONE_OM_ADDRESS_KEY));
+ exitCode = cmd.execute("om", "quota", "start", "--service-host", conf.get(OZONE_OM_ADDRESS_KEY));
Review Comment:
This line is being changed in #7653, too, so it would be great if we could merge that one first.
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/quota/QuotaStatus.java:
##########
@@ -35,7 +35,7 @@
mixinStandardHelpOptions = true,
versionProvider = HddsVersionProvider.class
)
-public class QuotaStatus implements Callable<Void> {
+public class QuotaStatus extends RepairTool {
@CommandLine.Spec
private static CommandLine.Model.CommandSpec spec;
Review Comment:
Not new to this PR, but this can be removed.
```suggestion
```
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/repair/om/quota/QuotaRepair.java:
##########
@@ -48,18 +45,14 @@
QuotaTrigger.class,
},
description = "Operational tool to repair quota in OM DB.")
-@MetaInfServices(RepairSubcommand.class)
-public class QuotaRepair implements RepairSubcommand {
-
- @CommandLine.ParentCommand
- private OzoneRepair parent;
+public class QuotaRepair {
public OzoneManagerProtocolClientSideTranslatorPB createOmClient(
String omServiceID,
String omHost,
boolean forceHA
) throws Exception {
- OzoneConfiguration conf = parent.getOzoneConf();
+ OzoneConfiguration conf = new OzoneConfiguration();
Review Comment:
```suggestion
OzoneConfiguration conf = getOzoneConf();
```
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-12039. Enhancements to ozone repair om commands [ozone]
Posted by "sarvekshayr (via GitHub)" <gi...@apache.org>.
sarvekshayr commented on code in PR #7662:
URL: https://github.com/apache/ozone/pull/7662#discussion_r1908233202
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneRepairShell.java:
##########
@@ -128,14 +128,14 @@ private String[] parseScanOutput(String output) {
public void testQuotaRepair() throws Exception {
CommandLine cmd = new OzoneRepair().getCmd();
- int exitCode = cmd.execute("quota", "status", "--service-host", conf.get(OZONE_OM_ADDRESS_KEY));
+ int exitCode = cmd.execute("om", "quota", "status", "--service-host", conf.get(OZONE_OM_ADDRESS_KEY));
assertEquals(0, exitCode, err);
- exitCode = cmd.execute("quota", "start", "--service-host", conf.get(OZONE_OM_ADDRESS_KEY));
+ exitCode = cmd.execute("om", "quota", "start", "--service-host", conf.get(OZONE_OM_ADDRESS_KEY));
Review Comment:
Noted.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-12039. Enhancements to ozone repair om commands [ozone]
Posted by "sarvekshayr (via GitHub)" <gi...@apache.org>.
sarvekshayr commented on PR #7662:
URL: https://github.com/apache/ozone/pull/7662#issuecomment-2579890226
> Thanks @sarvekshayr for updating the patch.
>
> (Let's not bundle logically separate changes in the same PR. I understand that the part which adds check for running OM in two classes would have been too small in itself for a separate PR. However, also adding check for running SCM or datanode in other repair classes, it would have been large enough and still one topic.)
Got it. I'll follow this for the upcoming tasks.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-12039. Enhancements to ozone repair om commands [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #7662:
URL: https://github.com/apache/ozone/pull/7662#issuecomment-2579697783
Thanks @sarvekshayr for updating the patch.
(Let's not bundle logically separate changes in the same PR. I understand that the part which adds check for running OM in two classes would have been too small in itself for a separate PR. However, also adding check for running SCM or datanode in other repair classes, it would have been large enough and still one topic.)
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-12039. Enhancements to ozone repair om commands [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #7662:
URL: https://github.com/apache/ozone/pull/7662
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org