Repository navigation
fix(data-modeling): create tier schedule when update finds it gone - #116697
posthog[bot] wants to merge 1 commit into
Conversation
The schedule listing reads Temporal's eventually consistent visibility store, so it can name a tier schedule that is already deleted. The update then fails with NOT_FOUND, the reconcile aborts, and a bootstrap marks the saved query not materialized. Fall back to create, and to update again if a concurrent reconcile created it first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: a26fc1c4-c176-4b6f-a499-6349484d24a5
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
🤖 CI report
|
| File | Comment lines | Added lines |
|---|---|---|
products/data_modeling/backend/logic/schedule_reconcile.py |
4 | 16 |
products/data_modeling/backend/test/test_schedule_reconcile.py |
2 | 36 |
This check does not block merging. It updates on every push and clears when the share drops.
There was a problem hiding this comment.
Approved.
Contained scheduling race fix with regression coverage; no model, API, ingestion, or infrastructure contract changes and no open review concerns. The verified Inbox provenance exempts the machine author from the bot-author refusal rule.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 28L, 1F substantive, 71L/2F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1b-small (71L, 2F, single-area, fix) |
| stamphog 2.5.0 | .stamphog/policy.yml @ 2b52f61 · reviewed head 2b52f61 |
Problem
_apply_reconciliationplans fromtemporal.list_schedules, which reads Temporal's eventually consistent visibility store.to_update, anda_update_scheduleraisesRPCErrorNOT_FOUND._bootstrap_dag_best_effortthen setsis_materialized=False.to_createbranch already handles the opposite race (ScheduleAlreadyRunningErrorfalls back to update). Theto_updatebranch had no fallback.Origin
0fa379dChanges
created, so a later failure in the same run rolls it back, the same as for a normal create.create_or_convergehelper that both loops share. OtherRPCErrorstatuses still raise as before.How did you test this code?
hogli test products/data_modeling/backend/test/test_schedule_reconcile.pypasses locally.masterand passes with this change.mypyonschedule_reconcile.pypasses.Test rationale: The new test,
test_listed_tier_that_is_already_gone_is_recreated_and_stays_materialized, catches a regression where a listed tier that is already gone aborts the bootstrap and switches materialization off. The closest existing test,test_concurrent_create_converges_to_update_without_rollback, covers only the opposite race on the create path. The test runs throughbootstrap_dag_to_tiers, because the user-visible symptom is theis_materializedrollback on that path.Release status
Docs update
None. No user-facing behavior changes beyond the bug fix.
🤖 Agent context
Autonomy: Fully autonomous
Agent: Claude Code, Claude Opus 5.5 (
claude-opus-5-5)schedule_reconcile.py, so the two PRs do not conflict.🤖 Generated with Claude Code
Created with PostHog Desktop from this inbox report.