Consolidated metadata (Zarr V3) - #91
Open
konstibob wants to merge 1 commit into
Open
Conversation
konstibob
force-pushed
the
consolidated-metadata
branch
from
August 26, 2026 17:02
ce90729 to
7b98a74
Compare
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.
Implemented consolidated metadata for Zarr according to specs
zarr-developers/zarr-specs#136
A group can now store a copy of the metadata of everything below it in its own metadata file, so a
hierarchy opens with one read instead of one read per node, not having to go through the whole zarr
structure.
Cache is optional, so on cache miss the old way of going through the files is applied! Same if we
can't interpret the cache, or a single entry in it, for example because another implementation wrote
a field we don't know yet. Consolidating also copies each node's metadata over untouched, so the
cache never holds less than the nodes themselves.
The cache is a snapshot and is deliberately never rebuilt or discarded automatically: if a lookup
finds a node that isn't in the cache we warn that it's out of date and read that node normally, and
there's an opt-out when opening a group. What we can't catch is a node that was changed after
consolidating, that still looks like a normal cache hit. zarr-python has the same limit.
Tested against zarr-python in both directions, it reads what we write and we read what it writes.
The entry ordering and how subgroups are marked in the cache come from that.
Only Zarr v3. v2 has
.zmetadata, which is a different mechanism and not supported here.