-
Notifications
You must be signed in to change notification settings - Fork 594
HDDS-8830. Add admin CLI to list open files #5920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
jojochuang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this would list both visible and invisible (keys that are written but no hsync() is called at it) keys. If that's the intend it would be good to distinguish them in the output.
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/ListOpenFilesSubCommand.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java
Show resolved
Hide resolved
That makes sense. Thanks for taking a look at the draft.
Uh-oh now I remembered that As of commit 094af14 I have added the KeyTable seek logic to correctly determine hsync'ed keys. But one optimization I would do is to update ozone admin om listopenfiles -id om-service-id -p /volumelof/buck11 global open files (estimated). Showing 1 open files (limit 100) under path prefix:
/volumelof/buck1
Client ID Hsync'ed Path
111700912364912641 Yes /volumelof/buck1/-9223372036854774527/key1
Reached the end of the list. |
… KeyInfos not having `HSYNC_CLIENT_ID` metadata.)
|
You can check out OmMetadataManagerImpl.getExpiredOpenKeys() ozone/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java Line 1808 in f4a3b0e
to see how we tell a key has hsync or not. You shouldn't need to walk through the keyTable. |
|
Just a few comments on the CLI portion of this change:
|
|
Thanks @errose28 for the comment.
+1 this. But in this way we'd also need to rename all other commands (e.g.
This is basically a command that enumerates I do like the idea of
Yup it is supposed to work with FSO/OBS/LEGACY. Path to a bucket (or just a key prefix) can be optionally passed to limit the scope. But without it (or when passing root as the path) it just iterates over two
I planned to. But it is not finalized yet so I will do that later. Plus I will add it to the markdown doc as well.
I think we need both. |
As I can see it is using the same approach as mine to check whether a key is hsync'ed or not. AFAIK the metadata tag is the only way to do it at the moment. Plus Again, the problem is that |
|
Filed HDDS-10077 for hsync metadata tag improvement. |
… for consistency.
…CY as well, and to make it easier for JSON output consumers.
|
Looks like branch HDDS-7593 needs a master branch merge before I can cleanly base this PR on to that one. |
…NABLED` to be flipped to `false` in `testAdminCmdListOpenFiles`.
adoroszlai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @smengcl for the patch.
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/ListOpenFilesSubCommand.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java
Outdated
Show resolved
Hide resolved
|
Right now this is returning object IDs in the path of the keys, which were previously only internal to OM. What is the expected use of this CLI? If it is to do some sort of file close/reclamation based on key name the current paths returned will not help. Alternatively, providing the actual full paths may be problematic because keys can remain open after their parent directories or buckets are deleted, and only the final commit will fail. |
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMetrics.java
Show resolved
Hide resolved
At the beginning I figure this command is just supposed to return what is there in the I think just like hdfs's, this command is mostly for admins to get a rough idea of how many files are open, and which ones. Thus human-readable output is important. JSON output might be used for scripting. The We could also return the |
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
Show resolved
Hide resolved
jojochuang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Merging this one so we can begin testing in actual environments.
|
Thanks @jojochuang for merging this to the HDDS-7593 feature branch. And thanks @adoroszlai and @errose28 for the reviews and comments. Will post a PR for HDDS-10077 that depends on this one. |
What changes were proposed in this pull request?
Add Ozone Admin CLI
listopenfilesas a debug command for admins and devs. e.g.JSON output:
{ "openKeys" : [ { "keyInfo" : { "metadata" : { }, "objectID" : -9223372036854774015, "updateID" : 7, "parentObjectID" : -9223372036854774527, "volumeName" : "volume-lof", "bucketName" : "buck1", "keyName" : "key0", "dataSize" : 4194304, "keyLocationVersions" : [ ... ], "creationTime" : 1704808722487, "modificationTime" : 1704808722487, "replicationConfig" : { "replicationFactor" : "THREE", "requiredNodes" : 3, "replicationType" : "RATIS" }, "fileName" : "key0", "acls" : [ ... ], "path" : "-9223372036854774527/key0", "file" : true, "replicatedSize" : 12582912, "objectInfo" : "OMKeyInfo{volume='volume-lof', bucket='buck1', key='key0', dataSize='4194304', creationTime='1704808722487', objectID='-9223372036854774015', parentID='-9223372036854774527', replication='RATIS/THREE', fileChecksum='null}", "hsync" : false, "latestVersionLocations" : { ... }, "updateIDset" : true }, "openVersion" : 0, "clientId" : 111726344437039105 }, { "keyInfo" : { ... }, "openVersion" : 0, "clientId" : 111726344440578050 }, { "keyInfo" : { ... }, "openVersion" : 0, "clientId" : 111726344441233411 } ], "totalOpenKeyCount" : 5, "hasMore" : true, "contToken" : "/-9223372036854775552/-9223372036854775040/-9223372036854774527/key2/111726344441233411" }What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8830
How was this patch tested?