adapter: keep catalog upper up-to-date with read ts#35402
Draft
teskje wants to merge 1 commit intoMaterializeInc:mainfrom
Draft
adapter: keep catalog upper up-to-date with read ts#35402teskje wants to merge 1 commit intoMaterializeInc:mainfrom
teskje wants to merge 1 commit intoMaterializeInc:mainfrom
Conversation
|
Thanks for opening this PR! Here are a few tips to help make the review process smooth for everyone. PR title guidelines
Pre-merge checklist
|
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.
48877df to
3cdbc15
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_rawis 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_uppercall replaces aconfirm_leadershipcall, 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