-
Notifications
You must be signed in to change notification settings - Fork 516
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-12094. Update BasicKeyInfo to include isFile payload #7740
base: master
Are you sure you want to change the base?
Conversation
0cb669b
to
c5e588f
Compare
@Test | ||
public void testListKeyDirectoriesAreNotFiles() | ||
throws IOException { |
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.
Could not add this test to testListKey
due to checkstyle limit of 150 lines per method. Created a new test instead.
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.
Is it possible to use ParameterizedTest
in testListKey to include the NotFile cases you added here?
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.
I think we need to be careful about backward compatibility.
@@ -1182,6 +1182,7 @@ message BasicKeyInfo { | |||
optional hadoop.hdds.ECReplicationConfig ecReplicationConfig = 7; | |||
optional string eTag = 8; | |||
optional string ownerName = 9; | |||
optional bool isFile = 10; |
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.
BasicKeyInfo was added in HDDS-9079 (1.4.0).
@@ -254,7 +255,7 @@ public static BasicOmKeyInfo getFromProtobuf(String volumeName, | |||
basicKeyInfo.getFactor(), | |||
basicKeyInfo.getEcReplicationConfig())) | |||
.setETag(basicKeyInfo.getETag()) | |||
.setIsFile(!keyName.endsWith("/")) | |||
.setIsFile(basicKeyInfo.getIsFile()) |
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.
If an old client send a request containing BasicKeyInfo to a new OM, the isFile field will not be set and a file would always be identified as not a file.
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.
@ptlrs can you please add test case in hadoop-ozone/dist/src/main/smoketest/compatibility/read.robot
?
What changes were proposed in this pull request?
The name of directories and subdirectories do not have a trailing slash.
This results in them being interpreted as files instead of directories.
As a result
isFile()
incorrectly returnstrue
even for directories.This PR :
isFile
payload to theBasicKeyInfo
proto messageBasicOmKeyInfo
to get/set theisFile
statusWhat is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-12094
How was this patch tested?
Added new integration test in
OzoneRpcClientTests#testListKey
.CI: https://github.com/ptlrs/ozone/actions/runs/12945031804