Repository navigation
Commit 6cdfcca
committed
fix(plan): resolve physical parent tables in AuditOnlyRunStage
BuiltInPlanEvaluator.visit_audit_only_run_stage() previously built its
Scheduler using only stage.snapshots (the audited snapshots) and no
deployability_index. As a result, parent references rendered as environment
views rather than the plan's physical tables, causing missing-table errors
or silent reads of stale parent rows after a failed prod plan, misrouting
dev parents and non-representative @this_model targets to prod views, and
preventing parent start-date inheritance and EMBEDDED parent expansion.
- Add all_snapshots and deployability_index to AuditOnlyRunStage, schedule
audit-only snapshots after BackfillStage (partitioning snapshots that
depend on after-promote backfills or non-metadata schema migrations into
a post-after-promote AuditOnlyRunStage before VirtualLayerUpdateStage),
and skip unselected/unpromoted snapshots whose dev tables are not created.
- Shallow-copy snapshots (and their interval lists) in
visit_audit_only_run_stage() before passing them to Scheduler.audit() so
in-place interval refresh/removal never mutates shared Snapshot instances
held by other stages or CachingStateSync, and forward ignore_cron,
selected_snapshots, circuit_breaker, and deployability_index.
- Scope interval refresh, removal-interval calculation, and
missing_intervals() computation to selected_snapshots during audit-only
runs, and skip get_snapshots_to_create() / CreateNode DDL when
audit_only=True.
Fixes #6256
Signed-off-by: Vamsi-klu <nrvamsi13@gmail.com>1 parent 1f96a72 commit 6cdfcca
8 files changed
Lines changed: 2004 additions & 37 deletions
File tree
- sqlmesh/core
- plan
- snapshot
- tests/core
- integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
276 | 290 | | |
277 | | - | |
| 291 | + | |
278 | 292 | | |
279 | 293 | | |
280 | 294 | | |
281 | 295 | | |
282 | 296 | | |
| 297 | + | |
283 | 298 | | |
284 | 299 | | |
285 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
286 | 304 | | |
287 | 305 | | |
288 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
| 100 | + | |
| 101 | + | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
| |||
344 | 348 | | |
345 | 349 | | |
346 | 350 | | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| |||
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
375 | 404 | | |
376 | 405 | | |
377 | 406 | | |
| |||
416 | 445 | | |
417 | 446 | | |
418 | 447 | | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
419 | 457 | | |
420 | 458 | | |
421 | 459 | | |
| |||
604 | 642 | | |
605 | 643 | | |
606 | 644 | | |
607 | | - | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
608 | 650 | | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
609 | 657 | | |
610 | 658 | | |
611 | 659 | | |
| |||
616 | 664 | | |
617 | 665 | | |
618 | 666 | | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
619 | 684 | | |
620 | 685 | | |
621 | 686 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
187 | 188 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | 189 | | |
196 | 190 | | |
197 | 191 | | |
| |||
314 | 308 | | |
315 | 309 | | |
316 | 310 | | |
| 311 | + | |
| 312 | + | |
317 | 313 | | |
318 | 314 | | |
319 | 315 | | |
| |||
505 | 501 | | |
506 | 502 | | |
507 | 503 | | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
521 | 520 | | |
522 | 521 | | |
523 | 522 | | |
| |||
858 | 857 | | |
859 | 858 | | |
860 | 859 | | |
861 | | - | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
862 | 866 | | |
863 | 867 | | |
864 | 868 | | |
| |||
1059 | 1063 | | |
1060 | 1064 | | |
1061 | 1065 | | |
| 1066 | + | |
1062 | 1067 | | |
1063 | 1068 | | |
1064 | 1069 | | |
| |||
1079 | 1084 | | |
1080 | 1085 | | |
1081 | 1086 | | |
| 1087 | + | |
| 1088 | + | |
1082 | 1089 | | |
1083 | 1090 | | |
1084 | 1091 | | |
| |||
1094 | 1101 | | |
1095 | 1102 | | |
1096 | 1103 | | |
| 1104 | + | |
1097 | 1105 | | |
1098 | 1106 | | |
1099 | 1107 | | |
| |||
1109 | 1117 | | |
1110 | 1118 | | |
1111 | 1119 | | |
| 1120 | + | |
1112 | 1121 | | |
1113 | 1122 | | |
1114 | 1123 | | |
| |||
1129 | 1138 | | |
1130 | 1139 | | |
1131 | 1140 | | |
| 1141 | + | |
| 1142 | + | |
1132 | 1143 | | |
1133 | 1144 | | |
1134 | 1145 | | |
| |||
1146 | 1157 | | |
1147 | 1158 | | |
1148 | 1159 | | |
| 1160 | + | |
1149 | 1161 | | |
1150 | 1162 | | |
1151 | 1163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2045 | 2045 | | |
2046 | 2046 | | |
2047 | 2047 | | |
| 2048 | + | |
2048 | 2049 | | |
2049 | 2050 | | |
2050 | 2051 | | |
| |||
2063 | 2064 | | |
2064 | 2065 | | |
2065 | 2066 | | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
2066 | 2070 | | |
| 2071 | + | |
| 2072 | + | |
2067 | 2073 | | |
2068 | 2074 | | |
2069 | 2075 | | |
| |||
0 commit comments