Files
orca/src/main/sqlite
Neil 345ffb56d2 perf(sqlite): refresh the legacy profile copy hourly and cap the profile WAL file (#40136)
* perf(sqlite): refresh the legacy profile copy hourly and recover crashed row caches

- The legacy whole-document refresh rewrote every changed split domain each 5 minutes
  (~4-8 MB per cycle, ~200 MB/hour of WAL plus checkpoint on an active profile). Writer
  start and graceful close already bring it current, so refresh at most hourly in between.
- Cap the profile-state WAL at 8 MB; without journal_size_limit it stayed at the size of
  the largest transaction ever written.
- Row caches: a read-only startup read cannot roll back a hot journal (or recover a WAL
  without -shm), so retry once on a writable connection instead of disabling the store
  on every launch.
- Row caches: drop the saved baseline when a commit throws, since COMMIT may report an
  error after the rows landed and our own commit does not move data_version.

* test(sqlite): accept Windows exit status for the crashed-writer fixture; document recovery cost

* docs(sqlite): state the crash-recovery cost without overstating its bound

* fix(sqlite): rebuild a row cache a crash left needing recovery instead of replaying it on main

* revert(sqlite): keep crash-recovery failures non-destructive; drop the rebuild fallback
2026-11-08 21:42:55 -08:00
..