-
Notifications
You must be signed in to change notification settings - Fork 627
HDDS-16117. Failed FSO multipart complete leaks bucket namespace quota #10984
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -944,6 +944,12 @@ public static long sumBlockLengths(OmKeyInfo omKeyInfo) { | |
|
|
||
| /** | ||
| * Return bucket info for the specified bucket. | ||
| * <p> | ||
| * The returned {@link OmBucketInfo} is the cached instance, returned by | ||
| * reference. A caller that mutates it (for example quota accounting) before a | ||
| * point where the request may still fail must first take a | ||
| * {@link OmBucketInfo#copyObject()} and publish that copy only on success, | ||
| * otherwise a failed request leaks the mutation into the cache. | ||
| */ | ||
| @Nullable | ||
| public static OmBucketInfo getBucketInfo(OMMetadataManager omMetadataManager, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this method is used in 25 places. From what I can tell, at least OMDirectoryCreateRequest has the same potential problem. I think we need more guardrails to prevent this same bug from happening again. A long term solution could include:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can pursue OmBucketInfo immutability https://issues.apache.org/jira/browse/HDDS-10317, mutable OmBucketInfo and OmKeyInfo has been a source of some bugs. |
||
|
|
||
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 is good. I suspect it's possible to make unit test with mocks inside TestS3MultipartUploadCompleteRequest instead.