Skip to content

fix(cold-store): durable nightly run log + deadline-spread dump retries (#13115) - #13152

Merged
dezren39 merged 1 commit into
mainfrom
lane-oj-13115
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-oj-13115

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Refs #13115 — lands asks 1 and 2. The issue stays open: ask 3 (three consecutive nightly runs filing an atlas export) is calendar evidence the nightly itself gathers.

Ask 1 — durable nightly output. nightly-backup.sh now tee's the whole run (stdout+stderr merged into one chronological stream) to $COLD_STORE_HOME/logs/nightly-<timestamp>.log, with nightly-latest.log symlinking the newest run. The exit code is the run's own verdict (PIPESTATUS), never tee's. If the log directory cannot be created, the run proceeds without the file and warns loudly — logging must never break the backup. The 2026-11-22 failure stage was unconfirmable because the systemd journal retained no entries for the unit; the next failed night names its step from the file alone.

Ask 2 — download strategy for a cut, non-resumable stream. After the existing second pass, download-stage failures (and only those — a rebuild or filing failure is deterministic) keep being retried in further passes while the run's deadline still leaves room for the wait plus one useful attempt window (60s, the same floor export_one applies before starting a database). The wait doubles between passes, capped at 900s. A retry-pass delay of 0 asks for no waiting, so the spread passes do not engage and the run ends after the second pass, exactly as before. Failure accounting is exact: a database transitioning from a download failure to a later-stage failure leaves the retry set and counts once in the final verdict.

Verification (laptop worktree at main 3a941eff430):

  • test_nightly_backup.py — 5/5 (2 new: durable log contents + latest symlink; uncreatable log dir still runs).
  • test_export_turso.py — 35/35 (1 new: a dump cut on the first two passes files on a deadline-spread third pass; the always-failing test now pins delay 1s + a 75s deadline and asserts the named no-room stop).
  • test_cold_store.py's export-script class currently fails identically on pristine main: a real export run is holding the script's lock tonight, and every failure in that class is the lock message — environmental contention, not this change.

Run Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Refs #13115 (acceptance stays open: three consecutive nightly runs
filing atlas is calendar evidence, gathered by the nightly itself).

Ask 1 — durable nightly output: nightly-backup.sh now tee's the whole
run (stdout+stderr merged into one chronological stream) to
$COLD_STORE_HOME/logs/nightly-<timestamp>.log, with a
nightly-latest.log symlink at the newest run. The exit code is the
run's own verdict (PIPESTATUS), never tee's. If the log directory
cannot be created the run proceeds without the file and warns loudly:
logging must never break the backup. The 2026-11-22 failure stage was
unconfirmable because the systemd journal retained no entries for the
unit; the next failed night now names its step from the file alone.

Ask 2 — a download strategy that survives a cut, non-resumable
stream: export-turso.sh already had curl's in-attempt retries plus one
second pass. After that second pass, download-stage failures (and
only those — a rebuild or filing failure is deterministic) keep being
retried in further passes while the run's deadline still leaves room
for the wait plus one useful attempt window (60s, the same floor
export_one applies before starting a database). The wait doubles
between passes, capped at 900. A retry-pass delay of 0 asks for no
waiting, so the spread passes do not engage and the run ends after
the second pass, exactly as before. Failure accounting is exact: a
database that transitions from a download failure to a later-stage
failure leaves the retry set and counts once in the final verdict.

Tests: nightly suite 5/5 (2 new: durable log contents + latest
symlink; uncreatable log dir still runs). Export suite 35/35 (1 new:
a dump cut on the first two passes files on a deadline-spread third
pass; the always-failing test now pins delay 1s + a 75s deadline and
asserts the named no-room stop). README updated for both behaviors.
Note: test_cold_store's export-script class fails identically on
pristine main while a real export run holds the script's lock —
environmental contention, not this change.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a98e6f86-97c6-42ce-a5c3-06fb6ac54d1a
Commits

Reviewing files that changed from the base of the PR and between d220c7b and d22136a.

Files selected for processing: 5

  • pkgs/cold-store-reaper/README.md
  • pkgs/cold-store-reaper/scripts/export-turso.sh
  • pkgs/cold-store-reaper/scripts/nightly-backup.sh
  • pkgs/cold-store-reaper/tests/test_export_turso.py
  • pkgs/cold-store-reaper/tests/test_nightly_backup.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T09:24:15.961269Z d22136a 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.

@dezren39
dezren39 merged commit 14904d7 into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the lane-oj-13115 branch November 23, 2026 09:23
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