Repository navigation
HDDS-16951. Remove the per-call InfoBucket from rooted-ofs rename on FSO buckets - #11674
yandrey321 wants to merge 5 commits into
Conversation
chungen0126
left a comment
There was a problem hiding this comment.
Thanks @yandrey321 for working on this. Overall LGTM, just left two minor comments.
| * file system rename can be sent without fetching the bucket to learn its layout. | ||
| */ | ||
| boolean isRenameRequiringFileSystemOptimizedSupported() { | ||
| return proxy.getOmVersion().compareTo(OzoneManagerVersion.RENAME_KEY_REJECTS_NON_FSO) >= 0; |
There was a problem hiding this comment.
Please use ComponentVersion#isSupportedBy.
| // Checked before Ratis only: preExecute does not run when the request is applied. The request was created for the | ||
| // link-resolved layout, and the OBJECT_STORE request class also serves LEGACY, so test the layout itself. | ||
| if (renameKeyRequest.getRequireFileSystemOptimized() && !getBucketLayout().isFileSystemOptimized()) { | ||
| throw new OMException("Bucket: " + renameKeyRequest.getKeyArgs().getBucketName() | ||
| + " has layout: " + getBucketLayout() + ", but the rename requires " | ||
| + BucketLayout.FILE_SYSTEM_OPTIMIZED + ".", OMException.ResultCodes.NOT_SUPPORTED_OPERATION); | ||
| } | ||
|
|
There was a problem hiding this comment.
Not directly related to this PR, just noting down for the record: if the operation fails in preExecute, it won't be recorded in the audit log.
|
@yandrey321 Please rebase to fix the failing CI checks. |
|
Rebased and updated code to adjust for changes in the master |
Change-Id: Ib34f5c3cbd765bfa86b39de5ce478f9ab0b5e8cb
|
The integration (client) failure is caused by the newly added OM version exposing an equality check in The test currently expects If-None-Match support only when The fix is to use I pushed the one-line fix on top of this PR's head to my fork: jojochuang@f6cfeb8 (branch Validation: The integration (ozone) failure is different: |
@chungen0126 Please check CI run in fork before triggering CI in Apache. The same test failed in fork.
There is no need to cherry-pick it, because it was pushed 2 minutes later to the PR branch.
This one was fixed on |
…icts Preserve MULTIPART_PART_IV at version 105 and assign RENAME_KEY_REJECTS_NON_FSO version 106. Co-authored-by: Codex (GPT-6) Change-Id: I9dd88ffbb1ab4523dc0b85f0feaf0114afe694d2
|
CI is green in the fork: https://github.com/yandrey321/ozone/actions/runs/40967890669 |
What changes were proposed in this pull request?
Problem. Rooted-ofs
renamefetches the bucket (InfoBucket, plusInfoVolume+InfoBucketper link hop)only to choose the algorithm: FSO sends one
RenameKey, LEGACY iterates over the keys, OBJECT_STORE is rejected onthe client. So every FSO rename costs 2 OM requests. OM cannot simply reject non-FSO buckets in
RenameKey: theshell, trash, key lifecycle and
OzoneBucket.renameKeysend it on any layout, and on LEGACY it renames one key.Implementation (same shape as HDDS-16760 / HDDS-16948):
RenameKeyRequestgetsoptional bool requireFileSystemOptimized = 4. When it is set,OMKeyRenameRequest.preExecute(inherited by the FSO request) rejects any bucket whose link-resolved layout isnot FILE_SYSTEM_OPTIMIZED with
NOT_SUPPORTED_OPERATION, before Ratis. It tests the layout, not the request class,because the OBJECT_STORE request class also serves LEGACY. Unlike
requireFileSystemLayout, it rejects LEGACY too.ClientProtocol.renameKey(..., requireFileSystemOptimized); the existing overload is unchanged.OzoneManagerVersion.RENAME_KEY_REJECTS_NON_FSO(104). From that version on,BasicRootedOzoneFileSystem.renamefirst sends the flagged
RenameKeywith nogetBucket(). Success andKEY_ALREADY_EXISTS/KEY_RENAME_ERROR/KEY_NOT_FOUNDare handled exactly as in today's FSO rename.NOT_SUPPORTED_OPERATION,BUCKET_NOT_FOUNDandVOLUME_NOT_FOUNDfall back to today's path fromgetBucket()on, so LEGACY renames, OBJECT_STORE rejections andmissing-bucket errors are unchanged. Older OMs, including
ZDU, keep today's path.Side effects.
RenameKeybefore today's path(the audit log shows a failed
RENAME_KEYbeforeINFO_BUCKET).OzoneBucket.renameKey) are unaffected.Generated-by: Claude Code (Claude Opus 5.5)
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16951
How was this patch tested?
Unit and integration tests
Benchmark
CPU savings. CPU profiles of the 10-thread run show the patch saves about 110 us of CPU per FSO rename: about
67 us on the client (46% of its CPU per rename) and about 44 us on the OM (about 20% of its request-handling CPU; the
write pipeline is unchanged). Almost all of it is per-RPC overhead, not OM work: the
InfoBucketrequest itself costsabout 2 us. It does not show up as throughput because the benchmark is bound by the OM's Ratis log fsync, not CPU.