Skip to content

fix(#120): MEDIUM: a shard backup copies a live WAL-mode SQLite with no quiesce step; resto - #431

Merged
BeSovereign merged 1 commit into
mainfrom
fix/issue-120
Oct 15, 2026
Merged

BeSovereign merged 1 commit into
mainfrom
fix/issue-120

Conversation

@BeSovereign

Copy link
Copy Markdown
Contributor

Refs #120

Db.createBackup now writes a consistent VACUUM INTO snapshot, checks it with integrity_check and renames it to webcalendar.db.backup with no raw-copy fallback, and a new worker (server/utils/dbBackup.js) writes it at production boot and then hourly, so the nightly shard backup always contains a whole copy. quiesceDatabase now fails when the checkpoint returns no result; this round changed no code because the earlier e2e failure did not recur (Playwright 76/76 twice, node 1768/1768), and the failing test name was not in the log, so the cause is unconfirmed.

Driver gates (measured, not claimed)

  • Suites: lint: 1 passed, 0 failed | node: 1768 passed, 0 failed | python: 104 passed, 0 failed | e2e: 76 passed, 0 failed
  • Red/green check on declared tests: server/test/issue120_consistent_backup_snapshot.test.js
red/green output
RED without the change:
acation_framework/worktrees/issue-120/server/test/issue120_consistent_backup_snapshot.test.js'
#   ]
# }
# Node.js v20.18.0
# Subtest: /home/agent-user/Coding/Freeshard/vacation_framework/worktrees/issue-120/server/test/issue120_consistent_backup_snapshot.test.js
not ok 1 - /home/agent-user/Coding/Freeshard/vacation_framework/worktrees/issue-120/server/test/issue120_consistent_backup_snapshot.test.js
  ---
  duration_ms: 55.018396
  location: '/home/agent-user/Coding/Freeshard/vacation_framework/worktrees/issue-120/server/test/issue120_consistent_backup_snapshot.test.js:1:1'
  failureType: 'testCodeFailure'
  exitCode: 1
  signal: ~
  error: 'test failed'
  code: 'ERR_TEST_FAILURE'
  ...
1..1
# tests 1
# suites 0
# pass 0
# fail 1
# cancelled 0
# skipped 0
# todo 0
# duration_ms 58.701088


GREEN with the change:
   ok 3 - each run replaces the previous snapshot with the current state
      ---
      duration_ms: 116.206905
      ...
    # Subtest: a stale temp file from an interrupted run does not block the next snapshot
    ok 4 - a stale temp file from an interrupted run does not block the next snapshot
      ---
      duration_ms: 45.98023
      ...
    1..4
ok 1 - Issue \#120 — consistent webcalendar.db.backup snapshot
  ---
  duration_ms: 853.228616
  type: 'suite'
  ...
# Subtest: the production server writes webcalendar.db.backup into its data directory at boot
ok 2 - the production server writes webcalendar.db.backup into its data directory at boot
  ---
  duration_ms: 915.675443
  ...
1..2
# tests 5
# suites 1
# pass 5
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 1840.385294

🤖 Generated with Claude Code

Db.createBackup now writes a consistent VACUUM INTO snapshot, checks it with integrity_check and renames it to webcalendar.db.backup with no raw-copy fallback, and a new worker (server/utils/dbBackup.js) writes it at production boot and then hourly, so the nightly shard backup always contains a whole copy. quiesceDatabase now fails when the checkpoint returns no result; this round changed no code because the earlier e2e failure did not recur (Playwright 76/76 twice, node 1768/1768), and the failing test name was not in the log, so the cause is unconfirmed.

Refs #120

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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