Repository navigation
fix(decomposedfs): write arbitrary metadata in one go - #791
Merged
Merged
Conversation
dschmidt
marked this pull request as ready for review
September 3, 2026 10:23
dschmidt
force-pushed
the
fix/atomic-arbitrary-metadata
branch
from
September 3, 2026 10:35
d181129 to
117ce3f
Compare
butonic
approved these changes
Sep 3, 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.
SetArbitraryMetadatalooped over the metadata map and wrote one attribute per call. Each of those is a separate read-merge-write on the node's metadata plus its ownPushToCache, so a set of N keys becomes N observable states. Readers (loadAttributes) take no lock and hit the cache first, so a concurrent stat can see a subset that was never written as a set.Every single write succeeds, nothing is lost. What the loop costs is atomicity: the iteration order is Go map order, so the subset a reader can observe differs on every run.
Now built as one map and written with
SetXattrsWithContext, a singleSetMultiple. Also drops N-1 read-merge-write cycles per call.No test: asserting this needs either a racing reader, which only hunts for the window, or a metadata backend injected into
testhelpers.NewTestEnv, which is a bigger change than the fix.