Skip to content

Disallow creating empty-prefix repositories on object stores - #2245

Merged
paraseba merged 2 commits into
mainfrom
push-qqqqnnxukrzq
Jun 29, 2026
Merged

Disallow creating empty-prefix repositories on object stores#2245
paraseba merged 2 commits into
mainfrom
push-qqqqnnxukrzq

Conversation

@paraseba

Copy link
Copy Markdown
Collaborator

No description provided.

@paraseba
paraseba requested review from TomNicholas, ianhi and li-em June 26, 2026 18:53

@TomNicholas TomNicholas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if someone creates a repo at the root of the bucket manually (e.g. by bulk-copying objects over from another location)? Presumably that is treated the same as any other pre-existing "rooted" store, because there is no on-disk difference, and no dependency on library versions.

Comment thread Changelog.python.md

- Expiration now records the full ancestry of pruned transaction logs in a new optional `pruned_ancestor_tx_logs` field on `SnapshotInfo`, so `diff`, `amend`, `rebase`, and `inspect` produce correct results after expiration ([#2184](https://github.com/earth-mover/icechunk/pull/2184)).
- The native S3 backend used to write every object under a leading slash (`/chunks/...`) when `prefix` was empty, which made repositories unreadable by external tools and could cause garbage collection to silently orphan objects. New empty-prefix repositories now use clean keys, and pre-existing "rooted" repositories are detected and handled automatically ([#2239](https://github.com/earth-mover/icechunk/issues/2239)).
- The native S3 backend used to write every object under a leading slash (`/chunks/...`) when `prefix` was empty, which made repositories unreadable by external tools and could cause garbage collection to silently orphan objects. Pre-existing "rooted" repositories are detected and handled automatically. Creating new repositories at an empty prefix on an object store is no longer allowed. Existing empty-prefix repositories can still be opened and updated ([#2239](https://github.com/earth-mover/icechunk/issues/2239)).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which made repositories unreadable by external tools and could cause garbage collection to silently orphan objects

So does this PR fix that for pre-existing "rooted" repositories?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no. sadly doing that would require moving all the /chunks objects. Also its a bit confusing so heads up that this is a PR merging into the other PR, not main

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, forgot to mention this needs to go on top of the previous PR to make sense


The `legacy_rooted_keys` parameter overrides that detection:
Creating a repository at an empty `prefix` (`None` or `""`) — i.e. at the
bucket root — is not supported on object stores in modern Icechunk versions

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bucket root — is not supported on object stores in modern Icechunk versions
bucket root — is not supported on object stores since Icechunk v2.1.0


When opening, the `legacy_rooted_keys` parameter overrides that detection:

- `None` (default) — auto-detect the layout by probing storage. Use this

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So presumably (I haven't looked at the implementation yet) in order to probe storage you make two concurrent requests for the two possible keys for the repo_info object.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we probe well-known objects in the v1 and v2 version formats, lazily on first access to the storage.

@ianhi ianhi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems good. especially for merging into the other pr

Comment thread icechunk/src/repository.rs Outdated
#[error("repositories can only be created in clean prefixes")]
ParentDirectoryNotClean,
#[error(
"creating a repository at an empty prefix (the object store bucket root) is not supported in modern Icechunk versions; use a non-empty prefix. Existing empty-prefix repositories can still be opened and updated."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cant make an inline suggestion here for some reason. But another spot for a specific version.

Comment thread Changelog.python.md

- Expiration now records the full ancestry of pruned transaction logs in a new optional `pruned_ancestor_tx_logs` field on `SnapshotInfo`, so `diff`, `amend`, `rebase`, and `inspect` produce correct results after expiration ([#2184](https://github.com/earth-mover/icechunk/pull/2184)).
- The native S3 backend used to write every object under a leading slash (`/chunks/...`) when `prefix` was empty, which made repositories unreadable by external tools and could cause garbage collection to silently orphan objects. New empty-prefix repositories now use clean keys, and pre-existing "rooted" repositories are detected and handled automatically ([#2239](https://github.com/earth-mover/icechunk/issues/2239)).
- The native S3 backend used to write every object under a leading slash (`/chunks/...`) when `prefix` was empty, which made repositories unreadable by external tools and could cause garbage collection to silently orphan objects. Pre-existing "rooted" repositories are detected and handled automatically. Creating new repositories at an empty prefix on an object store is no longer allowed. Existing empty-prefix repositories can still be opened and updated ([#2239](https://github.com/earth-mover/icechunk/issues/2239)).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no. sadly doing that would require moving all the /chunks objects. Also its a bit confusing so heads up that this is a PR merging into the other PR, not main


/// Creating a repository at an empty prefix (the bucket/container root) is refused on
/// every cloud object-store backend — native S3 and the `object_store`-based S3,
/// Azure, and GCS — but allowed on in-memory and local-filesystem storage, and via

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just be consistent everywhere?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, because having to pass a prefix for memory storage would be a pain without any reason, what does the prefix even mean for in memory (and a breaking change). For filesystem, i think it makes sense to support empty prefix, and it doesn't have the difficulties we have for testing in the case of object stores.

Base automatically changed from push-swnxomqllvqu to main June 29, 2026 19:55
@paraseba
paraseba force-pushed the push-qqqqnnxukrzq branch from f59b418 to 5fbfb16 Compare June 29, 2026 20:31
@paraseba
paraseba enabled auto-merge June 29, 2026 20:41
@paraseba
paraseba added this pull request to the merge queue Jun 29, 2026
Merged via the queue into main with commit c4e4959 Jun 29, 2026
40 checks passed
@paraseba
paraseba deleted the push-qqqqnnxukrzq branch June 29, 2026 21:03
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.

4 participants