bootstrap: fix as-of selection for compute reconciliation#26239
Merged
teskje merged 1 commit intoMaterializeInc:mainfrom Mar 28, 2024
Merged
bootstrap: fix as-of selection for compute reconciliation#26239teskje merged 1 commit intoMaterializeInc:mainfrom
teskje merged 1 commit intoMaterializeInc:mainfrom
Conversation
ade840a to
bf0f6a9
Compare
Contributor
Author
|
Nightlies look good. The failing output consistency checks are unrelated. |
ggevay
reviewed
Mar 27, 2024
Contributor
ggevay
left a comment
There was a problem hiding this comment.
I wrote some small comments. Will finish the review tomorrow.
bf0f6a9 to
949d7e4
Compare
ggevay
reviewed
Mar 28, 2024
This commit fixes another issue with dataflow as-of bootstrapping that could disable compute reconciliation. The oversight here was that an envd restart can make index write frontiers regress (since they are reset to their newly selected read frontiers), which makes it likely that using these frontiers to determine an as-of for compute dataflows will produce an as-of that is earlier than the frontiers of already installed dataflows have been allowed to compact to. The solution to this issue is to select as-ofs based on the frontiers of (transitive) storage dependencies instead. Storage frontiers cannot regress, so they are guaranteed to provide an as-of that is far enough advanced for reconciliation to succeed. The knowledge about transitive storage dependencies was not yet available during bootstrapping, so this commit adds it by converting the "index dependent MVs" collection step into a more generic "storage constraints" collection step that gathers all storage dependencies and storage dependants needed to constrain the initial timestamp for each dataflow. Finally, this commit merges the two `bootstrap_*_as_of` methods into a single one, to get rid of all the accumulated code and comment duplication.
949d7e4 to
a30ddb1
Compare
Contributor
Author
|
TFTR! |
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 fixes another issue with dataflow as-of bootstrapping that could disable compute reconciliation. The oversight here was that an envd restart can make index write frontiers regress (since they are reset to their newly selected read frontiers), which makes it likely that using these frontiers to determine an as-of for compute dataflows will produce an as-of that is earlier than the frontiers already installed dataflows have been allowed to compact to.
The solution to this issue is to select as-ofs based on the frontiers of (transitive) storage dependencies instead. Storage frontiers cannot regress, so they are guaranteed to provide an as-of that is far enough advanced for reconciliation to succeed.
The knowledge about transitive storage dependencies was not yet available during bootstrapping, so this PR adds it by converting the "index dependent MVs" collection step into a more generic "storage constraints" collection step that gathers all storage dependencies and storage dependants needed to constrain the initial timestamp for each dataflow.
Finally, this PR also merges the two
bootstrap_*_as_ofmethods into a single one, to get rid of all the accumulated code and comment duplication.Motivation
Fixes MaterializeInc/database-issues#7783
Tips for reviewer
I have not attempted to keep the changes minimal, so it's probably easier to review the two versions side-by-side, rather than as a line-by-line diff.
Checklist
$T ⇔ Proto$Tmapping (possibly in a backwards-incompatible way), then it is tagged with aT-protolabel.