Repository navigation
fix(usage): make rollup migrations atomic and mark late-committing finished runs - #10212
Conversation
…p migrations atomic Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e redundant 0465 BEGIN Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
No issues found across 9 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
This PR changes a database schema or migrates data. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.
Turn on auto-fix | Re-trigger cubic
[Medium impact] The reviewed changes appear safe to merge. SummaryThis PR makes rollup migrations atomic and marks older finished runs so activity reads do not wait for a later recheck.
No new actionable issues were found in the changes since the previous review. Reviews (2) · Last reviewed commit: "fix(usage): lock activity rollup marks i..." · Reviewed by Greptile |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
Fixes for the review findings on release #10207 that concern the activity rollup (#10200, #10201, #10203, #10205). Both rollup flags remain off.
COMMITfor their concurrent index builds, so 0462 and 0464 ran statement by statement after them. An interrupted upgrade then failed on every retry withrelation already exists. 0462 and 0464 now open a transaction first, as 0445 and 0447 do, so each file commits together with its journal row. 0465 runs inside 0464's transaction and needs no change. Schema and journal are unchanged; databases that already applied these files are unaffected.markFinishedRunsDirtymarks, in the completion transaction, the cells of runs that started at least the settle lag less an hour ago; younger runs lie in hours not computed yet and cost nothing. The stale-execution sweep reuses one end stamp across its batches, so it marks the runs it fails the same way.finally, as its neighbours do, so a failing assertion cannot leave it installed for later tests.Test plan
organization-activity-rollup.integration.tsagainst real Postgres: 36/36. The new case commits a completion stamped behind the scan and asserts reads match the legacy read before any pass runs; it goes red with the mark disabled.relation "activity_rollup_blocked" already existswithout them.check:migrations,apps/simtype-check, and the logger and stale-sweep unit tests pass.🤖 Generated with Claude Code