Skip to content

Keep the session catalog intact when analytics rebuilds fail - #207

Open
yaugenst wants to merge 2 commits into
nicosuave:mainfrom
yaugenst:yaugenst-flex/fix-atomic-analytics
Open

yaugenst wants to merge 2 commits into
nicosuave:mainfrom
yaugenst:yaugenst-flex/fix-atomic-analytics

Conversation

@yaugenst

@yaugenst yaugenst commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

TLDR

Why: Full analytics rebuilds currently clear the session catalog before scanning records and inserting the replacement. A read or insertion failure can leave the old catalog unavailable. Prepare the replacement first, then delete, insert, and mark it complete in one SQLite transaction. Refuse an index backfill whose scanned record count does not match the index inventory.

Customer impact: Failed rebuilds retain the previous session catalog, and successful replacements become visible atomically.

Validation: formatting, release Clippy, and 43 analytics unit tests passed in a dedicated build target. Regression coverage injects an insertion failure and verifies the previous complete catalog survives; it also checks visibility before and after replacement. Power-loss fault injection was not performed.

Based directly on upstream main; no feature PR must merge first. This branch includes the same small default-feature Clippy fix proposed separately in #205, so it can pass that gate independently. Git can merge the identical fix regardless of which PR lands first. The analytics change is isolated in its own commit.

CI: the first build test run failed while downloading the embedding model (Connection reset by peer), followed by poisoned shared-test-lock failures. GitHub rejected a failed-job rerun because it requires repository admin rights. CI remains blocked on a maintainer rerun.

Merge check: all six proposed branches merge cleanly pairwise, and the complete set merges cleanly in forward and reverse order against upstream 6044371. No feature stack or merge order is required. This is a Git merge check; combined runtime behavior was not separately exercised.

@yaugenst
yaugenst marked this pull request as ready for review September 19, 2026 21:05
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