Feat(state_sync): Add the ability to fetch all versions of a snapshot by name #5273
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 is the first in a series of PR's looking at adjusting and clarifying how restatements work.
Currently, when a model is restated in
prod
, the following occurs:The purpose of that last step is to prevent stale / old data from getting promoted to
prod
if someone decides to deploy a dev environment containing a version of the model that got built before the prod restatement occurred.However, the current implementation has a gap. It only clears intervals for snapshots that are promoted in dev environments, because it's limited by what
StateSync
methods are available and it currently iterates over all environments fromStateSync.get_environments_summary()
.What about snapshots that arent currently promoted in any environment? There is still a risk that someone makes a change in dev that matches one of these snapshots, and it becomes promoted in dev, and then gets deployed to prod.
So, this PR adds a method to
StateSync
that allows fetching all versions of a snapshot (based on name) regardless of if it's currently being used in an environment or not.This will allow the
prod
restatement "clear intervals" code to properly clear all relevant intervals across all snapshots of the model, rather than skipping intervals for snapshots that don't currently belong to any environment like it does today.