Skip to content

Prod plan rebuilds a child model after the janitor deletes an old forward-only parent version #6307

Backlog

Description

@mday-io

A prod plan can backfill a model's full history when only another parent's metadata changed. This happens if the janitor has deleted an older forward-only version of one of the model's parents. It started with #6214, which isn't in a release yet. v0.236.4 doesn't backfill in the same scenario.

To reproduce, start with incremental models a and b, and a child c that joins them:

  1. Apply all three to prod.
  2. Change the value of a column in a and apply it to dev with --forward-only. Do this twice, with a different value each time.
  3. Run sqlmesh janitor --ignore-ttl. With default settings, the first dev version of a expires after a week.
  4. Change only the owner of b, then run sqlmesh plan prod without --forward-only.

Expected: c keeps its current version and isn't backfilled. That's what happens if you skip step 3.

Actual: c gets a new version and a full backfill.

The plan builder looks up whether each earlier version of a was forward-only. If a version is no longer in state, it's treated as not forward-only, so c is rebuilt. #6214 chose that fallback on purpose, but the janitor deletes old versions routinely.

Reproduced on main at 9fa0b6e with DuckDB, using the Python API.

Activity

  1. added
    Bug
    on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions