Conversation
UpdateBases refused an explicit base ID that was already registered only on tables with managed blobs. On other tables the new base replaced the existing binding, so every data, deletion and index file stored through that ID resolved to the new location: the new version was published, and reading the existing rows failed with not-found errors. The same happened when a concurrent commit had been assigned that ID, because conflict resolution only compares IDs that both transactions named. Refuse an explicit ID already in the manifest on every table, with the existing managed-blob error. ID 0 still asks for an unused ID, unused explicit IDs are still accepted, and the name and path checks are unchanged.
geruh
left a comment
There was a problem hiding this comment.
LGTM I like the check at manifest construction time! Just left a small nit, nothing blocking. thanks 🙌!!!
| async fn test_add_bases_refuses_a_base_id_in_use() { | ||
| let test_dir = TempStrDir::default(); | ||
| let uri = format!("{}/primary", test_dir.as_str()); | ||
| let base = |id, name: &str| { |
There was a problem hiding this comment.
smol nit: this is duplicated setup with the other added test
| ); | ||
| } | ||
|
|
||
| /// Files refer to their base by ID, so binding an ID already in use to another |
There was a problem hiding this comment.
nit: do we need this comment? feels like the test name already explains it, and we have the reasoning in manifest_build file.
|
|
||
| /// Conflict resolution compares only IDs both transactions named, so an | ||
| /// explicit ID that a concurrent commit assigned is refused when the rebased | ||
| /// manifest is built. |
There was a problem hiding this comment.
nit: this one can stay but it also repeats the logic a bit
There was a problem hiding this comment.
✅ Gate recommendation: approve.
Rejecting ID reuse while assembling the current manifest closes both the direct overwrite and concurrent allocation paths before publication. The regressions verify that rejected additions preserve the version, base bindings, and existing rows, while unused explicit IDs and automatic allocation remain valid.
Xuanwo
left a comment
There was a problem hiding this comment.
Reviewed: removes the managed-blob-only guard so rebinding any registered base ID is refused everywhere - files resolve through base IDs, so an unbounded rebind redirects existing data/deletion/index files. ID 0 assignment, unused explicit IDs, and name/path checks are unchanged. Tests cover direct rebind refusal with dataset invariants intact and the stale-handle concurrent-commit case. CI green; approving.
Currently, adding a storage base with an existing ID could silently redirect file references and break reads, including during concurrent commits.
This PR rejects duplicate explicit base IDs on all tables, extending the existing managed-blob protection.