-
Notifications
You must be signed in to change notification settings - Fork 509
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
HDDS-10608. Recon can't get full key when using Recon API. #6492
Conversation
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 @ArafatKhan2198 for working on the patch. Changes LGTM +1
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.
@ArafatKhan2198 Thanks for working over this, given few comments.
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/codec/NSSummaryCodec.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/ContainerEndpoint.java
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java
Outdated
Show resolved
Hide resolved
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.
@ArafatKhan2198 backward compatibility is still not resolved, please check comments reply
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/codec/NSSummaryCodec.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/codec/NSSummaryCodec.java
Show resolved
Hide resolved
Thanks for the find @sumitagrawl Key Changes Made:
|
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.
@ArafatKhan2198 Thanks for working, have few more comments
...one/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTaskDbEventHandler.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java
Show resolved
Hide resolved
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.
@ArafatKhan2198 given few comments, plz check
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java
Outdated
Show resolved
Hide resolved
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.
@ArafatKhan2198 Plz find few minor comments, other LGTM
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java
Outdated
Show resolved
Hide resolved
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
The forked CI also passed :- https://github.com/ArafatKhan2198/ozone/actions/runs/9001895425 |
(cherry picked from commit 9074b8d)
(cherry picked from commit 9074b8d)
(cherry picked from commit 9074b8d)
(cherry picked from commit 9074b8d)
(cherry picked from commit 9074b8d)
(cherry picked from commit 9074b8d)
What changes were proposed in this pull request?
We've made some updates to improve how we manage and display complete file paths in recon. This includes a new way to build the full paths of files, especially useful for our FSO keys, ensuring that file paths are shown correctly no matter how they're stored.
Key Changes:
NSSummary
). This includes the introduction of aparentID
attribute for directories, enabling the recursive construction of paths from any given file or directory back to its root.OmKeyInfo
and the hierarchical structure of parent directories. This method begins with the key name from the providedOmKeyInfo
object and recursively prepends the names of parent directories by fetchingNSSummary
objects from the namespace summary manager. This process continues until a parent ID of-1
is encountered, indicating the root of the directory structure. Finally, the volume and bucket names are prepended to construct the complete path.To ensure simplicity in addressing the backward compatibility of NSSummary objects during deserialization, we've implemented a straightforward solution. When deserializing old data, if the parentId field is not present or is set to zero, we assign it a value of -1. This indicates that the parentId was not originally set, effectively differentiating old data from new without needing complex versioning systems. This approach is neatly integrated into our deserialization method, keeping the process clean and efficient.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10608
How was this patch tested?
Unit Testing :-
Wrote multiple unit test to test out the complete correct path and also to check if the parent ID is getting populated properly.
Manual Testing :-
The implementation of these changes has been thoroughly tested across various bucket layouts, including
FSO
,Legacy
buckets withFsEnabled
, and Object Storage Bucket (OBS
) layouts.FSO Bucket Path:
Legacy Bucket with FsEnabled:
OBS Bucket Path: