fix(db): pause call-log rotate on SQLITE_CORRUPT - #10979
Merged
diegosouzapw merged 1 commit intoAug 21, 2026
Merged
diegosouzapw merged 1 commit into
diegosouzapw merged 1 commit into
Conversation
rotateCallLogs swallowed pager corruption and kept retrying DELETEs against a malformed SQLite file while /healthz stayed 200. On SQLITE_CORRUPT / malformed / SQLITE_IOERR, pause further rotate writes and record the failure for /api/db/health. Does not auto-REINDEX. Closes the fail-closed gap in #10736.
diegosouzapw
merged commit Aug 21, 2026
fefca17
into
diegosouzapw:release/v3.8.50
7 of 16 checks passed
Sa3id23
pushed a commit
to Sa3id23/OmniRoute
that referenced
this pull request
Aug 21, 2026
⭐5 — Em SQLITE_CORRUPT/pager malformado durante rotação de call-log, pausa novas rotações em vez de retry de DELETE contra arquivo quebrado; /api/db/health reporta integrity_check_failed. Não faz REINDEX automático (inseguro em single-writer live). 4/4 testes novos + suíte irmã verde. Fecha o gap de diegosouzapw#10736.
AndrianBalanescu
pushed a commit
to AndrianBalanescu/OmniRoute
that referenced
this pull request
Aug 21, 2026
⭐5 — Em SQLITE_CORRUPT/pager malformado durante rotação de call-log, pausa novas rotações em vez de retry de DELETE contra arquivo quebrado; /api/db/health reporta integrity_check_failed. Não faz REINDEX automático (inseguro em single-writer live). 4/4 testes novos + suíte irmã verde. Fecha o gap de diegosouzapw#10736.
AndrianBalanescu
pushed a commit
to AndrianBalanescu/OmniRoute
that referenced
this pull request
Aug 28, 2026
⭐5 — Em SQLITE_CORRUPT/pager malformado durante rotação de call-log, pausa novas rotações em vez de retry de DELETE contra arquivo quebrado; /api/db/health reporta integrity_check_failed. Não faz REINDEX automático (inseguro em single-writer live). 4/4 testes novos + suíte irmã verde. Fecha o gap de diegosouzapw#10736.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
⭐5 — Em SQLITE_CORRUPT/pager malformado durante rotação de call-log, pausa novas rotações em vez de retry de DELETE contra arquivo quebrado; /api/db/health reporta integrity_check_failed. Não faz REINDEX automático (inseguro em single-writer live). 4/4 testes novos + suíte irmã verde. Fecha o gap de diegosouzapw#10736.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SQLITE_CORRUPT/ malformed pager /SQLITE_IOERRduring call-log rotation, pause further rotate writes instead of retrying DELETEs against a broken file./api/db/healthreportsintegrity_check_failed(Pager reported SQLITE_CORRUPT during call-log-rotate: …).Does not auto-
REINDEX. That remains unsafe on a live single-writer file.Related Issues
Validation
node --import tsx/esm --test tests/unit/call-log-rotate-corrupt.test.ts(4/4)tests/unit/call-log-file-rotation.test.tsswallow-filesystem case still passesnpm run lint(CI)origin/release/v3.8.50(266e39d36)Tests Added Or Updated
tests/unit/call-log-rotate-corrupt.test.tsCoverage Notes
src/lib/db/healthCheck.tspager-note helpers +src/lib/usage/callLogRotation.tsfence covered by the new file.call-log-file-rotation.test.tsfailed on this machine becausebetter-sqlite3is built for NODE_MODULE_VERSION 137 vs local 147 (sql.js fallback). Unrelated to this fence; CI image has a matching native module.Reviewer Notes
/healthzstays process-lifecycle only (by design). Degraded DB is/api/db/health.integrity_check, Longhorn block PVC) is on the issue.