mempalace-native: read-only open fails on a WAL database without sidecars
What happens
VectorIndex::load_from_sqlite (crates/mempalace-core/src/lib.rs) opens the sqlite_exact database with SQLITE_OPEN_READ_ONLY | SQLITE_OPEN_URI. A clean WAL-mode database usually has no -wal/-shm sidecars after its last writer closes, and on SQLite builds that cannot create the shared-memory index from a read-only connection this fails with SQLITE_CANTOPEN. That is the same failure class #2490 fixed on the Python side for #2489 (Apple's system SQLite).
Impact
- Inside MemPalace,
RustExactCollection._ensure_native_indexcatches the load error, logsFailed to load Rust native vector index, and queries fall back to the Pythonsqlite_exactpath, sorust_exactsilently loses its native speed-up rather than failing. - The standalone
mempalace-nativeexecutable has no fallback, sostats/bench/searchfail on such a database.
Expected
Mirror config.connect_sqlite_read: when the file is WAL (header byte 18 == 2) and both sidecars are absent, open read-write (or otherwise establish the WAL index) instead of read-only.
Raised by Copilot on #2519 (review of the v3.10.0 promotion) and verified against develop @ ce54d5d. Not a release blocker for default installs.
Source: MemPalace/mempalace