Skip to content

Consolidated metadata (Zarr V3) - #91

Open
konstibob wants to merge 1 commit into
zarr-developers:mainfrom
konstibob:consolidated-metadata
Open

Consolidated metadata (Zarr V3)#91
konstibob wants to merge 1 commit into
zarr-developers:mainfrom
konstibob:consolidated-metadata

Conversation

@konstibob

Copy link
Copy Markdown
Contributor

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.

@konstibob
konstibob force-pushed the consolidated-metadata branch from ce90729 to 7b98a74 Compare August 26, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant