Skip to content

Record a coverage backfill after DJ launches it - #2457

Merged
shangyian merged 1 commit into
mainfrom
backfill-record-after-launch
Aug 25, 2026
Merged

Record a coverage backfill after DJ launches it#2457
shangyian merged 1 commit into
mainfrom
backfill-record-after-launch

Conversation

@shangyian

@shangyian shangyian commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

We should only record a backfill if it was successfully launched via the query service. If it wasn't, then DJ will never try to reconcile a failed backfill.

With this PR, we only record the backfill in the database after run_cube_backfill returns.

Test Plan

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

@netlify

netlify Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit 7bc0edc
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/6a8d9086d3345c0008d7a41d

`_plan_coverage_backfill` wrote the record at planning time, but the launch
happens after the deploy commits and never raises. A launch the query service
refused therefore left a record behind, `backfill_recorded` returned true
forever, and the cube was silently locked out of that span. It has happened
three times in production, and the only way out was editing `coverage.from`.

The record now goes in only once `run_cube_backfill` returns. The swap carries
what the write needs -- the materialization's id and the partition column's
name, resolved at planning time -- so the write does not depend on ORM state
surviving the commit. It commits on its own, and a write that fails is logged
and warned about rather than raised at a deploy that has already committed.

The job url the query service hands back goes into the row's `urls`, so a
person can check what a record stands for.
@shangyian
shangyian force-pushed the backfill-record-after-launch branch from 392abe0 to 7bc0edc Compare August 25, 2026 12:54
@shangyian
shangyian marked this pull request as ready for review August 25, 2026 13:44
@shangyian
shangyian merged commit d5028aa into main Aug 25, 2026
21 checks passed
@shangyian
shangyian deleted the backfill-record-after-launch branch August 25, 2026 13:44
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