Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix Metadata locking and Reading for decomposedfs and align defaults with OpenCloud#722

Open
rhafer wants to merge 10 commits into
opencloud-eu:mainfrom
rhafer:ocissue/3059
Open

Fix Metadata locking and Reading for decomposedfs and align defaults with OpenCloud#722
rhafer wants to merge 10 commits into
opencloud-eu:mainfrom
rhafer:ocissue/3059

Conversation

@rhafer

@rhafer rhafer commented Jul 2, 2026

Copy link
Copy Markdown
Member

This reworks the metadata interfaces to prevent misuse of the LockAndRead and AllWithLockedSource methods.

The LockAndRead method is removed completely. It returned an io.Reader object that seemed to be useful for reading the Nodes Attributes from it. That was however misleading. For most of the current backed the
Reader is pointing to the metadata lockfile instead of the metadata source itself.

The AllWithLockedSource is replaced with the new method AllWhileLocked it does require the reader parameter. But requires the caller to take care that the Metadata was locked with Lock() before calling.

All of the callers where adjusted to no longer pass the reader around. And the unused ParentWithReader method.

This switches the default metadata backend for decomposedfs to "messagepack" to align with the hardcoded default in OpenCloud, which is force to "messagepack" for all decomposedfs setups.

This switches the default metadata backend for decomposedfs to
"messagepack" to align with the hardcoded default in OpenCloud, which is
force to "messagepack" for all decomposedfs setups.
@rhafer rhafer self-assigned this Jul 2, 2026
…lockfiles

This reworks the metadata interfaces to prevent misuse of the
`LockAndRead` and `AllWithLockedSource` methods.

The `LockAndRead` method is removed completely. It returned an io.Reader
object that seemed to be useful for reading the Nodes  Attributes from
it. That was however misleading. For most of the current backed the
Reader is pointing to the metadata lockfile instead of the metadata
source itself.

The `AllWithLockedSource` is replaced with the new method
`AllWhileLocked` it does require the reader parameter. But requires the
caller to take care that the Metadata was locked with `Lock()` before
calling.

All of the callers where adjusted to no longer pass the reader
around. And the unused ParentWithReader method.

Fixes: opencloud-eu/opencloud#3059
@rhafer rhafer changed the title chore(decomposedfs): Align defaults with OpenCloud Fix Metadata locking and Reading for decomposedfs and align defaults with OpenCloud Jul 2, 2026
@rhafer rhafer added the Type:Bug label Jul 2, 2026
@rhafer rhafer requested a review from aduffeck July 2, 2026 15:22
@rhafer rhafer marked this pull request as ready for review July 3, 2026 06:36
aduffeck added 4 commits July 7, 2026 10:39
Each node now knows whether it has already been locked or not, allowing
for conditional locking and simplifying of the code because of less
special handling of locked/unlocked cases.
aduffeck added 4 commits July 8, 2026 10:56
This prevents leaking lock-state into goroutines.
This is used to hold node locks only in the scope of a goroutine. If a
locked node was to leak into another goroutine the goroutinelock Lock
would return false and thus make the other goroutine lock the node for
themselves.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants