ozone
ozone copied to clipboard
HDDS-10559. Add a warning or a check to run repair tool as System user
What changes were proposed in this pull request?
We added a repair tool for snapshot chain fix as part of PR: https://github.com/apache/ozone/pull/6386
This check was missed in the original PR. This task is to add a check or warning to make sure that the repair tool is run as system user (default to hdfs)
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10559
How was this patch tested?
Unit test
cc. @hemantk-12 @errose28
Thanks for adding this @DaveTeng0. The repair command could have uses on all nodes, not just OM. I think it is also difficult to figure out which user is usually being used to run each process from this command. I'm thinking that instead of trying to check the value against a "correct" value that's hard to determine, we can just print a message to stderr every time like:
Running as user <user>. Make sure this is the same user used to run the Ozone process.
The repair command will be infrequently used, so I think printing messages like this every time are ok. If someone knows a reliable way to get the user that runs each process though let me know and we can use that instead.
Yeah it makes sense! updated command message accordingly! Thanks @errose28 !
Hello! If no further new comments, please feel free to merge! Thanks!
Thanks, @DaveTeng0 for the change and @errose28 for the review.