-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-10319. Also consider bucket layout deciding whether to normalize path for listKeys #6195
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
…teKeyOps.testOmBucketReadWriteKeyOps.
…ed on bucket layout with fsPath config.
…ed on bucket layout with fsPath config.
…ed on bucket layout with fsPath config.
|
@sumitagrawl @sadanand48 Pls review. |
tanvipenumudy
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.
Thank you @devmadhuu for the patch. I have a few minor nits.
I think it might also help to have parameterization around any of the existing testcases for the configuration: ozone.om.enable.filesystem.paths (if possible) - if we do not have one already, thanks.
| startKey = OmUtils.normalizeKey(startKey, true); | ||
| keyPrefix = OmUtils.normalizeKey(keyPrefix, true); | ||
| } | ||
| /*startKey = OMClientRequest |
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.
This line seems unintentional, could you please address this if not needed?
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 @tanvipenumudy for review. I have removed the commented code.
sadanand48
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 @devmadhuu for the fix, Was this issue causing any tests to fail? Is there a unit test which verifies this?
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
Outdated
Show resolved
Hide resolved
Since we have not added any new configuration, existing test case are already covering it. |
Thanks @sadanand48 for the review. Yes an existing Test |
Can we make it parameterized to have a test for this fix . something like below and set config based on the boolean @ParameterizedTest(name = "Filesystem Paths Enabled: {0}")
@ValueSource(booleans = {false, true})
public void testOmBucketReadWriteKeyOps(boolean fsPathsEnabled) throws Exception {
try {
startCluster(fsPathsEnabled); |
Yes, its added now. Pls re-review. |
sadanand48
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 @devmadhuu for addressing comments . LGTM
|
Thanks @devmadhuu for the fix, @sadanand48, @tanvipenumudy for the review. |
…to normalize path for listKeys (apache#6195) (cherry picked from commit d3e2e59) Change-Id: Id8692efa4a9e6996efea592b82751db91796cbf1
… path for listKeys (apache#6195) (cherry picked from commit d3e2e59)
What changes were proposed in this pull request?
This PR is to fix normalization of keyPrefix path based on bucket layout. We have "
ozone.om.enable.filesystem.paths" as false by default. This config is currently global irrespective of any check for bucket layout. Ideally this config should be checked along with bucket layout because being a global config, path normalization logic should not be applicable for all bucket types. Config makes sense only for LGEACY bucket types only.When we have OBS or LEGACY bucket having keyPrefix starting with "/" like "/readPath/" and fsPath config ("
ozone.om.enable.filesystem.paths" ) is enabled (true), then code flow will hit normalization of key during org.apache.hadoop.ozone.om.KeyManagerImpl#listKeys API call flow and normalized key will be "vol/buck/readPath", but in keyTable, key will be saved as "vol/buck//readPath/", so it doesn't match and listKeys API wouldn't be able to retrieve the key with normalized key path.Test
org.apache.hadoop.ozone.freon.TestOmBucketReadWriteKeyOps.testOmBucketReadWriteKeyOpswas failing whenozone.om.enable.filesystem.pathswas set to true.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10319
How was this patch tested?
Patch was tested using existing Junit and integration tests.