Repository navigation
[Bug] session-query-sqlite reserves the WAL writer for TEMP-only search refreshes #14038
Replies: 1 comment
|
Related operations/lifecycle improvement, separate from which transaction mode to use: please expose supported file-backed connection tuning and an abortable lock wait. Using a synchronous busy handler with a long timeout can park the host; leaving it at zero makes real write contention fail immediately. In a local integration, an asynchronous backoff around |
Uh oh!
There was an error while loading. Please reload this page.
What fails
With
@deepseek-ai/dsh-session-query-sqliteconfigured for a file-backed WAL database,searchSessionscan fail withSESSION_QUERY_INDEX_FAILED/database is lockedwhen the only pending index change is in the connection-localtemp.live_sessions/temp.live_docstables. There is no pending durable session change. An unrelated SQLite connection holding a reserved WAL writer lock does not otherwise prevent reads.Confirmed on the stock DSH 0.2.2-rc.5 implementation, Windows, Node 26.13.1, SQLite 3.54.1. A source check of
masterat2e39e704finds the same unconditionalBEGIN IMMEDIATEin thehasWritesbranch. I did not build or execute that commit.Synthetic reproduction
openAt: 'first-search',journalMode: 'wal', and a new temporary file. Do not mount session persistence, so any live changes go only to TEMP. Run an initialsearchSessions({query: 'arctic telescope'})to open the service.node:sqliteDatabaseSyncconnection. ExecuteBEGIN IMMEDIATEand keep that transaction open. This is a lock holder, not a second session-query provider.searchSessionsagain while the lock is held.5(SQLITE_BUSY), wrapped asSESSION_QUERY_INDEX_FAILED. The error occurs at_reconcile'sBEGIN IMMEDIATE, before writing TEMP. Roll back the lock holder infinally.Proposed fix
Split the existing
hasWritesdecision into durable writes vs. TEMP-only writes. KeepBEGIN IMMEDIATEfor durable inserts/replacements/deletes; use deferredBEGINfor TEMP-only work and keep the same transaction and rollback semantics. A local test of this split on the same SQLite version completed while the WAL writer remained held, with one new TEMP row and unchanged durable generation. This is not a proposal to allow multiple index writers.Two adjacent improvements can be tracked separately: existing report #10721 covers replacement scans; a new session also takes that path unnecessarily (confirmed with a stock integration test), so skipping
DELETEwhen there is no matching metadata row is a small, schema-neutral improvement. #9695 covers cold indexing on the interactive path; making durable index preparation an explicit operation would help there. Neither is a prerequisite for the TEMP-only transaction fix.All reactions