Fix no-gaps plans when production advances before promotion - #5947
Draft
mday-io wants to merge 1 commit into
Draft
Fix no-gaps plans when production advances before promotion#5947mday-io wants to merge 1 commit into
mday-io wants to merge 1 commit into
Conversation
Signed-off-by: mday-io <mdaytn@gmail.com>
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.
Summary
no_gapscheck as the final concurrency guardRoot cause
A plan freezes its interval horizon when it is constructed. If the existing production snapshot advances before that plan reaches promotion, the candidate can finish every originally scheduled batch yet still be behind the live production frontier. Promotion then correctly rejects the candidate for missing intervals.
The new catch-up stage refreshes candidate intervals and schedules the additional live-frontier gaps immediately before promotion. If production advances again after that read, the existing transactional guard still fails safely.
Validation
make fast-test— 2,603 fast tests, 0 failures, 4 skipped; isolated suites also passedpytest tests/core/test_plan_evaluator.py -q— 2 passedgit diff --check upstream/main— passedmake stylereaches only the local missing generatedsqlmesh._versionmypy errors; no changed-file type errorsResidual race behavior
Production can still advance in the small window after catch-up. In that case, the retained promotion guard rejects the plan rather than allowing a gap.