storage: factor out initialization of storage hosts#13924
Merged
Conversation
There were two issues with the initialization of storage hosts:
* Creating new sources in an already initialized controller sent the
`InitializationComplete` command *after* sending the initial
`CreateSources` command. This was not wrong in practice, because the
storage host in this case was sure to be empty and performing
reconciliation was therefore a no-op, but it was conceptually
incorrect.
* Creating new sink did not send `InitializationComplete`, which
presented as `storaged` processes never receiving the CreateExports
command.
This commit solves both of these issues by pushing responsibility for
sending `InitializationComplete` into the `StorageHosts` object. Once
`StorageHosts::initialization_complete` is called, new storage hosts are
sent the `InitializeComplete` command during provisioning; the create
source and create sink code paths no longer *both* need to remember to
do this, nor can they send the command in the wrong order.
Co-authored-by: Chae Jubb <chae@materialize.com>
cjubb39
approved these changes
Jul 28, 2022
madelynnblue
added a commit
that referenced
this pull request
Jul 29, 2022
Revert "storage: factor out initialization of storage hosts (#13924)"
benesch
added a commit
to benesch/materialize
that referenced
this pull request
Jul 29, 2022
…aterializeInc#13924)"" This reverts commit 9ae043a.
3 tasks
benesch
added a commit
to benesch/materialize
that referenced
this pull request
Jul 30, 2022
…aterializeInc#13924)"" This reverts commit 9ae043a.
3 tasks
benesch
added a commit
to benesch/materialize
that referenced
this pull request
Jul 30, 2022
…aterializeInc#13924)"" This reverts commit 9ae043a.
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.
@cjubb39 as we discussed today! I figured I'd get a CI run out overnight for validation of this fix.
There were two issues with the initialization of storage hosts:
Creating new sources in an already initialized controller sent the
InitializationCompletecommand after sending the initialCreateSourcescommand. This was not wrong in practice, because thestorage host in this case was sure to be empty and performing
reconciliation was therefore a no-op, but it was conceptually
incorrect.
Creating new sink did not send
InitializationComplete, whichpresented as
storagedprocesses never receiving the CreateExportscommand.
This commit solves both of these issues by pushing responsibility for
sending
InitializationCompleteinto theStorageHostsobject. OnceStorageHosts::initialization_completeis called, new storage hosts aresent the
InitializeCompletecommand during provisioning; the createsource and create sink code paths no longer both need to remember to
do this, nor can they send the command in the wrong order.
Co-authored-by: Chae Jubb chae@materialize.com
Motivation
Checklist
This PR has adequate test coverage / QA involvement has been duly considered. (Not adding tests because they'll be covered by Chae's forthcoming PR.)
This PR evolves an existing
$T ⇔ Proto$Tmapping (possibly in a backwards-incompatible way) and therefore is tagged with aT-protobuflabel.This PR includes the following user-facing behavior changes: