Skip to content

fix(state): bound dashboard rollups to their source range - #1324

Merged
frahlg merged 1 commit into
masterfrom
fix/storage-progress-20260920
Sep 20, 2026
Merged

frahlg merged 1 commit into
masterfrom
fix/storage-progress-20260920

Conversation

@frahlg

@frahlg frahlg commented Sep 20, 2026

Copy link
Copy Markdown
Member

On v3.7.1-beta.1, a Pi with 20,007 recent dashboard rows failed 27 completed maintenance runs. Dashboard rollup exhausted each two-hour deadline, leaving later archive stages unable to run. SQLite's plan scanned the recent resolution to find each bucket's newest JSON, even after the batch shrank to one minute.

Read only the indexed source range and build weighted summaries in Go. Keep that read and the replacement/deletion in one SQLite snapshot, using the existing short write budget and fresh-snapshot retry. Report a bucket that cannot fit the minimum write budget instead of retrying it until the full maintenance deadline. This preserves sample weights and newest detail without changing the schema or retention policy.

Validation:

  • A 20,000-row fixture with 4 KiB detail failed its ten-second deadline before the fix. After the fix, the 768-row rollup took about 0.15 seconds on macOS and 0.55 seconds in a separate test database on the Pi's SD card.
  • Regression tests cover live writes during the read, late rows included after snapshot retry, and transaction rollback/retry without lost or repeated samples.
  • Existing dashboard energy, restart and retention tests passed locally and on the Pi. The new concurrency and rollback tests passed locally with the race detector.
  • Full local make verify passed.

The running production service still uses the released beta. These tests do not yet prove that its archive backlog has cleared or establish long-term SD write volume.

Related: #1280, #1287.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-20T12:48:39.623342Z 0d7cfa8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@frahlg
frahlg merged commit 8ef33c0 into master Sep 20, 2026
16 checks passed
@frahlg
frahlg deleted the fix/storage-progress-20260920 branch November 11, 2026 09:21
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