HDDS-15456. Add SCM DB lookup and identify orphan(wrt SCM) and deleted-but-present containers#10547
HDDS-15456. Add SCM DB lookup and identify orphan(wrt SCM) and deleted-but-present containers#10547sreejasahithi wants to merge 4 commits into
Conversation
|
@devmadhuu could you please review this PR. |
|
cc @rnblough |
devmadhuu
left a comment
There was a problem hiding this comment.
Thanks @sreejasahithi for the patch. Largely looks good. Some review comments, Pls check.
devmadhuu
left a comment
There was a problem hiding this comment.
@sreejasahithi PR changes largely looks good, few comments in code inline and some nits below for better tool reliability:
- Can do a simple sanity check for clusterID between datanode VERSION filesand scm DB clusterId. This will help user to avoid any accidental use of some other cluster SCM DB and avoid large number of invalid orphan container reporting.
- We have changed from -
-countto--lengthoption now , so if any existing code may break , may need to rethink from backward compatibility point of view.
Thanks for the suggestions. I added a cluster ID check between the DataNode VERSION file and the SCM DB cluster ID on mismatch we print a warning and skip orphan/deleted reporting. |
devmadhuu
left a comment
There was a problem hiding this comment.
Thanks @sreejasahithi for improving the patch. Largely looks good to me. Just one nit. Please check.
| out().println("To identify orphan containers (wrt SCM) and containers that are marked as DELETED in SCM but" | ||
| + " exist in the datanode's current directory, provide the SCM database path using the --scm-db option." | ||
| ); | ||
| } |
There was a problem hiding this comment.
What if scmDb != null but path not correct, so both above if and else if will skip and code just continues to printDuplicates and return null, i.e. exits successfully.
What changes were proposed in this pull request?
This PR extends
ozone debug datanode container analyzewith optional SCM metadata lookup via --scm-db option.When a scm.db path is provided, the command classifies each container ID found during the on-disk DataNode scan HDDS-15455 against SCM metadata and reports:
Containers in SCM with any other lifecycle state are skipped. Without --scm-db, the command prints a hint that SCM lookup is required for orphan and deleted-but-present detection and displays only the duplicate container information.
What is the link to the Apache JIRA
HDDS-15456
How was this patch tested?
Tested in docker cluster by manually creating the inconsistencies
Sample outputs: