Repository navigation
Keep journal cleanup from freezing chat actions - #37802
Closed
brennanb2025 wants to merge 20 commits into
Closed
brennanb2025 wants to merge 20 commits into
brennanb2025 wants to merge 20 commits into
Conversation
11 tasks done
brennanb2025
added a commit
that referenced
this pull request
Nov 3, 2026
Revert the live-history compaction and incremental vacuum added by #36053 to remove their serving-thread stall risk for the release. Preserve retired-history cleanup, saved formats/readers/writers and already-compacted sparse histories; add sparse reopen/write/reopen coverage. Temporary: redundant live history can grow until the separate repair tracked in #37802 is ready. Older synchronous saves remain. Tracked in STA-13374 and STA-13375. Six focused suites / 40 tests, independent correctness/architecture/final comparison and final-head CI passed.
audichuang
pushed a commit
to audichuang/orca
that referenced
this pull request
Nov 4, 2026
…7873) Revert the live-history compaction and incremental vacuum added by stablyai#36053 to remove their serving-thread stall risk for the release. Preserve retired-history cleanup, saved formats/readers/writers and already-compacted sparse histories; add sparse reopen/write/reopen coverage. Temporary: redundant live history can grow until the separate repair tracked in stablyai#37802 is ready. Older synchronous saves remain. Tracked in STA-13374 and STA-13375. Six focused suites / 40 tests, independent correctness/architecture/final comparison and final-head CI passed. (cherry picked from commit 25c6757)
…p retries Attachment claim cleanup no longer holds one database snapshot across every filesystem check. Claims gain a never-reused AUTOINCREMENT identity through an atomic rebuild at writable open; each cleanup pass captures the highest identity once and reads 32-row identity pages in short released scans before any filesystem work or write admission. Pages recheck pair and identity under the existing admission, and the native prune stays pair-only. Local structured session-tab sync now registers its disposal and retry owner before the first await, so a failed initial capability read or a rejected stale inventory schedules the existing bounded retry instead of leaving no subscription.
Restore the live-history cleanup that #37873 temporarily removed, now on the off-thread native writer, and port main's retained-input, logical context, queue and ownership changes onto the asynchronous journal boundary.
Apply main's single-client frame projection fix (#38336) where this PR moved mobile session tab delivery.
Prepare logical rewind rows and receipts in yielding pieces under the existing reservation, read historical input evidence in bounded indexed pages, and restore multirow projection rollback and retry coverage.
Build the replacement state, input owner, queue order, claim settlement and returned rows in yielding pieces on a detached copy, switch to it once after the native commit, and finish status and request-failure projections in awaited, freshness-checked pieces. Route journal SQL workers through the managed worker spawn and restore the main tests' work-count assertions on the async paths.
Assert per-page cleanup and claim-sweep operation counts at N and 10N with foreground progress between maintenance units, cover format-1 survival, refusals and the previous two stable releases' reads, writes and claim identity continuity against the migrated database, and await the async journal APIs in the released-chat upgrade test.
Route concurrent status reads during a replacement refresh through the finite ordered preparation, prepare subscriber reset hydration and public view normalization in yielding pieces, publish Stop settlement and process death immediately during ordinary writes, and count real subscriber delivery in the replacement bound test.
Load the real subscription module once in beforeAll, explain the older-build tests' timeout, and shrink the baseline for the three findings this PR removed.
…ng replacement Guard current snapshots, hydration, subscriptions, history pages, batch indexes and current-work reads at one shared derived-read boundary while a journal's replacement refresh is pending, and keep Stop and steering gates on the last installed status projection during that refresh.
Accept main's removal of the queued public-read test; this PR only adapted it to the async journal API.
…ime-limited batches
Contributor
Author
|
Superseded by #39256. |
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.
Problem
Large saved chat backlogs can freeze Orca while journal cleanup runs a single SQLite operation on the desktop main thread or server request thread. A reporter-size run observed a cleanup page lasting 5.4 seconds and a separate commit lasting 4.5 seconds; pauses between pages cannot interrupt either operation.
Change
Move journal database execution to one background writer, with separate bounded readers for history, restore and cleanup discovery. Keep chat state, ordering and publication in the existing host, and publish accepted changes only after their commit is known. Cleanup shares that writer in finite units so foreground actions can run between units. Preserve existing saved formats, chat content, receipts, accepted-write durability and restart behavior.
This is the follow-up repair to merged #36053, tracked in STA-13374. The separate streaming cadence and checkpoint policy work remain outside this PR.
Validation
Author checks: 238 named suites passed, one skipped; 2,208 tests passed and five skipped. Scoped formatting and lint pass across the changed files; the node typecheck and changed-code quality checks pass. The remaining consumer selection passed 13 suites initially; all four repaired suites now pass their 55 tests. Node, web and CLI typechecks pass. The fresh E2E typecheck has zero test-file diagnostics, with existing cloud/mobile dependency diagnostics outside that ratchet. The general changed-check runner selects tests implicitly; scoped checks and explicit named test files are used under the repository scoped-selection exception, with final CI still owed.
Full review, head CI, reporter-size comparisons against freshly pinned current main in both vacuum modes, the four sustained streaming cells, actual older-reader and downgrade/re-upgrade contracts, and real Claude and Codex lifecycle QA are still pending. The historical attribution experiment was incomplete and is not a performance pass. This PR is not ready to merge.
Intended behavior: native database execution has no serving-thread fallback because that execution causes the measured freeze; existing accepted-write durability and streamed-save exception are retained; existing checkpoint policy and saved-format boundaries remain unchanged.