Skip to content

adapter: keep catalog upper up-to-date with read ts#35402

Draft
teskje wants to merge 1 commit intoMaterializeInc:mainfrom
teskje:catalog-strict-serializable
Draft

adapter: keep catalog upper up-to-date with read ts#35402
teskje wants to merge 1 commit intoMaterializeInc:mainfrom
teskje:catalog-strict-serializable

Conversation

@teskje
Copy link
Contributor

@teskje teskje commented Mar 10, 2026

This PR introduces a way to advance the frontier of the catalog shard without appending any new updates and then uses that to keep the catalog shard's frontier up to date with the oracle read ts. This ensures that mz_catalog_raw is always readable with strict serializable isolation, since under that isolation level, the oracle read ts will be used as the query timestamp.

This increases the amount of CRDB queries we make, instead of bumping only the txn-wal, we now additionally need to bump the catalog shard. But note that in two of the three instances the advance_upper call replaces a confirm_leadership call, which also did a CRDB query, so one can hope that the resulting number of CRDB calls is similar.

This could potentially be further improved by moving the catalog shard into txn-wal, but that's a larger lift so we leave it as future work.

Motivation

Closes SQL-117

@github-actions
Copy link

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).

This commit introduces a way to advance the frontier of the catalog
shard without appending any new updates and then uses that to keep the
catalog shard's frontier up to date with the oracle read ts. This
ensures that `mz_catalog_raw` is always readable with strict
serializable isolation, since under that isolation level, the oracle
read ts will be used as the query timestamp.

This increases the amount of CRDB queries we make, instead of bumping
only the txn-wal, we now additionally need to bump the catalog shard.
But note that in two of the three instances the `advance_upper` call
replaces a `confirm_leadership` call, which also did a CRDB query, so
one can hope that the resulting number of CRDB calls is similar.

This could potentially be further improved by moving the catalog shard
into txn-wal, but that's a larger lift so we leave it as future work.
@teskje teskje force-pushed the catalog-strict-serializable branch from 48877df to 3cdbc15 Compare March 10, 2026 16:36
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