-
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-10367. Fix possible NullPointerException in listKeysLight method #6221
Conversation
...n/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
Show resolved
Hide resolved
...n/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
Outdated
Show resolved
Hide resolved
…rotocolPB/OzoneManagerProtocolClientSideTranslatorPB.java Co-authored-by: Maksim Myskov <maxim.myskov@gmail.com>
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 @ivanzlenko for the patch.
Please add test case (for non-light listStatus
) in TestListStatus#testSortedListStatus
.
@adoroszlai I've added additional test cases but looking at test coverage all changes were covered already. Looks like some of the issues with s3a protocol were fixed in HDDS-9762, but my fixes should prevent future cases where we accidentally could pass 'null' for startKey. |
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 @ivanzlenko for updating the patch.
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestListKeysWithFSO.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
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 @ivanzlenko for restoring package in the test class.
Interestingly, the new test case passes without the added null
checks, so it does not seem to exercise the code path being changed.
@adoroszlai we have some preliminary checks for nulls in intermediary code. So this test cases here for good measure. I believe we would've caught HDDS-9762 earlier having cases with null value. |
...n/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
Outdated
Show resolved
Hide resolved
if (startKey != null) { | ||
listStatusRequestBuilder.setStartKey(startKey); | ||
} |
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.
Since this is also a ListStatusRequest
, I think we need to set ""
in else
branch here, too.
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.
@ivanzlenko Thanks for working over this, its fix for consistency with listKeys, but do not have any NullPointerException as startKey as null is expected value.
And for improving test cases.
Thanks @ivanzlenko for the patch, @myskov, @sumitagrawl for the review. |
@myskov @sumitagrawl @adoroszlai thanks for review! |
…Light (apache#6221) (cherry picked from commit 1830fe2) Change-Id: Ib7da5a7886b3a3a39b900f9f3e7ba0e406547153
…Light (apache#6221) (cherry picked from commit 1830fe2)
What changes were proposed in this pull request?
Fix possible NullPointerException which can occur in some cases while invoking listKeysLight from OzoneManagerProtocolClientSideTranslatorPB.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10367
How was this patch tested?
This patch is test manually.
Separate epic created to cover testing of hdfs client with S3A protocol: https://issues.apache.org/jira/browse/HDDS-10381