fix(services/goosefs): skip CreateDirectory when rename parent already exists - #8129
Merged
Xuanwo merged 1 commit intoAug 23, 2026
Merged
Conversation
…y exists CACHE_THROUGH make_directory on an existing parent is a CosN round-trip, not a metadata no-op. Create the destination parent only if Master reports it missing after rename.
Xuanwo
approved these changes
Aug 23, 2026
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.
Which issue does this PR close?
Closes #.
Rationale for this change
GooseFS write-via-temp publishes with
rename(tmp → final)in the same parent directory.CreateFile(recursive)on the temp path already creates that parent, butGoosefsCore::renamestill calledcreate_directory(parent, recursive)whenever the destination was missing.The comment treated that RPC as a cheap Master no-op. Under
CACHE_THROUGH, Master still sync-persists the directory to UFS, so an already-existing parent pays a full object-store round-trip (about45–55msin our CosN measurements; four small Lance files add~0.19s).flowchart TD start[rename tmp to final] stat[get_status dst] exists{dst exists?} dir{dst is directory?} overwrite{if_not_exists?} del[delete dst] rename1[Master rename] ok{rename Ok?} src{source still exists?} mkdir[create_directory parent] rename2[Master rename retry] done[done] fail[return error] cnm[ConditionNotMatch] start --> stat stat --> exists exists -->|yes| dir dir -->|yes| fail dir -->|no| overwrite overwrite -->|true| cnm overwrite -->|false| del --> rename1 exists -->|NotFound| rename1 rename1 --> ok ok -->|yes| done ok -->|NotFound| src src -->|no| fail src -->|yes| mkdir --> rename2 --> done