Skip to content

Fix independent ownership of snapshot tables during cleanup - #6085

Closed
IuraHD wants to merge 2 commits into
SQLMesh:mainfrom
IuraHD:codex/upstream-sqlmesh
Closed

IuraHD wants to merge 2 commits into
SQLMesh:mainfrom
IuraHD:codex/upstream-sqlmesh

Conversation

@IuraHD

@IuraHD IuraHD commented Sep 22, 2026

Copy link
Copy Markdown

Description

Two snapshots can have different production versions but share a development table. Expiring one can delete the other snapshot's table or remove its interval coverage. This can be reproduced with breaking and forward-only development branches.

Track production and development table ownership independently, using gateway and physical table identity for deletion decisions. Keep logical interval ownership separate, hydrate shared development coverage across production versions, and preserve defaults for previously serialized cleanup tasks.

Adds 17 regression cases covering shared ownership, physical separation, persisted intervals, compaction, batch ordering and a normal planning workflow with a surviving development environment.

Test Plan

  • 114 targeted tests pass offline: 17 new cases and 97 existing cleanup/expiration/interval cases (283 unrelated cases deselected).
  • Ruff check and format pass for all six changed files; migration numbering validation passes.
  • Installing the full style tools exposed a missing Optional annotation in interval filters, now fixed. Re-running mypy reports no errors in the changed files, but the full repository check still reports 118 errors across other files, including missing Spark, dbt, web and language-server dependencies. This is not a full successful type-check.
  • The complete make fast-test suite has not been run. Keeping this PR in draft pending full environment/CI validation and maintainer feedback on ownership representation.

Checklist

  • I have run make style and fixed any issues
  • I have added tests for my changes
  • All existing tests pass (make fast-test)
  • My commits are signed off (git commit -s) per the DCO

Signed-off-by: Iurie Virlan <38211890+IuraHD@users.noreply.github.com>
Signed-off-by: Iurie Virlan <38211890+IuraHD@users.noreply.github.com>
@IuraHD IuraHD closed this Sep 22, 2026
@IuraHD
IuraHD deleted the codex/upstream-sqlmesh branch September 22, 2026 20:26
@IuraHD
IuraHD restored the codex/upstream-sqlmesh branch September 22, 2026 20:34
@IuraHD IuraHD reopened this Sep 22, 2026
@IuraHD IuraHD closed this Sep 22, 2026
@IuraHD
IuraHD deleted the codex/upstream-sqlmesh branch September 22, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant