Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

flushPendingStores runs refreshSearchStatistics under the process lock — multi-minute write stall on daemon restart

Aperta
#697 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python, sqlite

Direzione di ricerca

Start at flushPendingStores and trace its call to BrainDatabase.refreshSearchStatistics, focusing on the process lock and write transaction around the call. Compare the three proposed approaches and inspect related issue #689's load-sensitive prepush test. Done means daemon restart flushing no longer holds the live database lock during the multi-minute statistics walk, with queue and chunk processing continuing safely.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Observed 2026-08-10 ~11:40-11:46: BrainBarDaemon restarted at 11:39:52 with pending stores queued; its flush path called BrainDatabase.refreshSearchStatistics() inside flushPendingStores while holding withPendingStoreProcessLock + a write txn. The stats refresh walks a full sqlite3BtreeCount over the 744k-chunk table (cold cache → ~6 minutes of disk btree walking). During that window: drain daemon stuck in SQLITE_BUSY open-retry (attempt 6/13 observed), watcher logging database-is-locked, maintenance seat's brain_store hard-failed at 120s transport abort. Self-resolved when the count finished; queue and chunks resumed immediately.

Stack sample (885/885 in one count): flushPendingStores → refreshSearchStatistics → sqlite3_exec → sqlite3BtreeCount → moveToChild → getAndInitPage.

Fix candidates: (1) move stats refresh OUTSIDE the process lock / write txn; (2) make it incremental or approximate (sqlite_stat1 or cached count with dirty flag); (3) skip stats refresh during flush entirely — flush is a replay path, not a query path.

Related: #692 (VACUUM freeze — same class: heavyweight ops holding write locks on the live DB), #689 (load-sensitive prepush test).

Filed by brainlayerClaude lead (Fable 5).

🤖 Generated with Claude Code

Lingua principale
Python
Stelle
9
Fork
7
Merge medio
2h 8m
PR unite (30g)
225

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di EtanHey/brainlayer

Tutte le issue di EtanHey/brainlayer

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.