Skip to content

adapter: bootstrap storage collections in dependency order#35933

Open
teskje wants to merge 1 commit intoMaterializeInc:mainfrom
teskje:bootstrap-storage-topological
Open

adapter: bootstrap storage collections in dependency order#35933
teskje wants to merge 1 commit intoMaterializeInc:mainfrom
teskje:bootstrap-storage-topological

Conversation

@teskje
Copy link
Copy Markdown
Contributor

@teskje teskje commented Apr 10, 2026

New builtin MVs that depend on other builtin MVs could fail as-of selection because the bootstrap code registered all derived collections (MVs, CTs) in a single batch. When computing a derived collection's since, the code queried the storage controller for dependency frontiers, but dependencies in the same batch weren't registered yet, so their (persisted) sinces were missed. This led to sinces that were too low, causing unsatisfiable as-of constraints.

Fix by registering collections in topological layers: each iteration drains and registers only the collections whose storage dependencies have all been registered. This ensures dependency frontiers are available when bumping the sinces of derived collections.

Motivation

Fixes MaterializeInc/database-issues#11273

Verification

Triggered the 0dt smoke test a couple times, which reproduced the issue before.

@github-actions
Copy link
Copy Markdown
Contributor

Thanks for opening this PR! Here are a few tips to help make the review process smooth for everyone.

PR title guidelines

  • Use imperative mood: "Fix X" not "Fixed X" or "Fixes X"
  • Be specific: "Fix panic in catalog sync when controller restarts" not "Fix bug" or "Update catalog code"
  • Prefix with area if helpful: compute: , storage: , adapter: , sql:

Pre-merge checklist

  • The PR title is descriptive and will make sense in the git log.
  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).

@teskje teskje force-pushed the bootstrap-storage-topological branch from 9779e6f to be78412 Compare April 10, 2026 13:04
New builtin MVs that depend on other builtin MVs could fail as-of
selection because the bootstrap code registered all derived collections
(MVs, CTs) in a single batch. When computing a derived collection's
since, the code queried the storage controller for dependency frontiers,
but dependencies in the same batch weren't registered yet, so their
(persisted) sinces were missed. This led to sinces that were too low,
causing unsatisfiable as-of constraints.

Fix by registering collections in topological layers: each iteration
drains and registers only the collections whose storage dependencies
have all been registered. This ensures dependency frontiers are
available when bumping the sinces of derived collections.
@teskje teskje force-pushed the bootstrap-storage-topological branch from be78412 to 8e77a62 Compare April 10, 2026 13:56
@teskje
Copy link
Copy Markdown
Contributor Author

teskje commented Apr 10, 2026

All the nightly failures look unrelated, so this should be good to go.

@teskje teskje marked this pull request as ready for review April 10, 2026 15:48
@teskje teskje requested a review from a team as a code owner April 10, 2026 15:48
@teskje teskje requested review from SangJunBak and ggevay April 10, 2026 15:48
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