This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Always save the latest available version of QuestionnaireStore. #1921
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.
What is the context of this PR?
Currently, we are able to read version 3 in production, but can only write version 2.
While making the changes to write version 3, it became clear that there is an issue around what version we are writing for the questionnaire store.
In a deployment as follows (I've represented the version of the data with
data_version
):version 2
saves QuestionnaireStore.{version=2, data_version=2}
version 3
loads QuestionnaireStore withversion 2
, upgrades toversion 3
, and saves{version=3, data_version=3}
version 2
loads QuestionnaireStore withversion 3
, and saves with{version=3, data_version=2}
At this point we have a mismatched version number, which will cause errors when an application tries to load it.
To avoid this, we can ensure that we always write the latest version which the current code can write, rather than the highest possible version.
How to review
I have a branch which adds the writing functionality of version 3. This can be used to test it.
2647-update-questionnaire-store-version-for-compression-and-new-answerstore-storage-format
, restart server, continue questionnaire.2647-update-questionnaire-store-version-for-compression-and-new-answerstore-storage-format
, merge this PR into it, continue your questionnaire.2647-update-questionnaire-store-version-for-compression-and-new-answerstore-storage-format
, continue questionnaire, and ensure it's all workingChecklist