HDDS-10200. OM may terminate due to NPE in S3SecretValue proto conversion#6089
Merged
adoroszlai merged 5 commits intoapache:masterfrom Jan 25, 2024
Merged
HDDS-10200. OM may terminate due to NPE in S3SecretValue proto conversion#6089adoroszlai merged 5 commits intoapache:masterfrom
S3SecretValue proto conversion#6089adoroszlai merged 5 commits intoapache:masterfrom
Conversation
Contributor
Author
|
@ArafatKhan2198 can you please also take a look? |
sadanand48
approved these changes
Jan 25, 2024
Contributor
sadanand48
left a comment
There was a problem hiding this comment.
Thanks @adoroszlai the patch, LGTM
szetszwo
reviewed
Jan 25, 2024
Contributor
szetszwo
left a comment
There was a problem hiding this comment.
@adoroszlai , thanks for working on this! Just a few minor comments inlined.
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/S3InMemoryCache.java
Show resolved
Hide resolved
| private boolean isDeleted; | ||
| private long transactionLogIndex; | ||
| private final String kerberosID; | ||
| private final String awsSecret; |
Contributor
There was a problem hiding this comment.
An unrelated comment: It is not a good idea store a secret in a plaintext String and write it to db.
The usual practice is to encrypt it in byte[] and erase it after use.
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/S3SecretValue.java
Outdated
Show resolved
Hide resolved
szetszwo
approved these changes
Jan 25, 2024
Contributor
szetszwo
left a comment
There was a problem hiding this comment.
+1 the change looks good.
Contributor
Author
|
Thanks @myskov, @sadanand48, @szetszwo for the review. |
adoroszlai
added a commit
to adoroszlai/ozone
that referenced
this pull request
Feb 21, 2024
…ersion (apache#6089) (cherry picked from commit 9238be3)
adoroszlai
added a commit
to adoroszlai/ozone
that referenced
this pull request
Feb 21, 2024
…ersion (apache#6089) (cherry picked from commit 9238be3)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Revoked S3 secret is stored in the cache as
S3SecretValuewithnullsecret value. Since the object is mutable, other thread could access the same instance before revocation, and might encounter NPE while trying to convert to protobuf.was seen in
TestMultiTenantVolume(4 / 1000 runs).This PR changes
S3SecretValueto be immutable.https://issues.apache.org/jira/browse/HDDS-10200
How was this patch tested?
TestMultiTenantVolumepassed 10x100:https://github.com/adoroszlai/ozone/actions/runs/7645630287
Regular CI:
https://github.com/adoroszlai/ozone/actions/runs/7645622076