Persist host type update and honor stored value after restart#4549
Open
Persist host type update and honor stored value after restart#4549
Conversation
Contributor
Author
|
Hm, we are also not updating the host type in the system table. |
Collaborator
See SpacetimeDB/crates/smoketests/tests/smoketests/views.rs Lines 569 to 573 in cacfd73 |
825da6c to
9e464e3
Compare
The host controller would use the host type as stored in the controldb to try and instantiate a module. That fails, however, if the module was updated while also changing the host type -- the controldb no longer has correct data about the database's state. Instead, hand out the module kind / host type when retrieving the program from the database itself. core, datastore: Persist host type / module kind Require `Program` to carry the module kind, and properly update `st_module` if a module update changes the host type.
9e464e3 to
3735d49
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.
Fixes two issues that would prevent updating a database while also changing the host type:
ModuleKindinst_module(hardcoded to wasm)st_modulewhen instantiating a moduleTo do so, the
Programtype from the datastore crate now carries theModuleKind, forcing call sites to make a decision.Small adjustments to the smoketests / guard crate where made when writing the test for this.
Expected complexity level and risk
1
Testing