{"record":{"id":"91a2b97877b0edb3","repo":"tursodatabase/turso","slug":"mvcc-logical-pull-is-not-supported-for-in-memory-s","errorCode":null,"errorMessage":"MVCC logical pull is not supported for in-memory sync server databases","messagePattern":"MVCC logical pull is not supported for in-memory sync server databases","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"cli/sync_server.rs","lineNumber":906,"sourceCode":"            .iter()\n            .find_map(|(boundary, crc)| (*boundary == offset).then_some(*crc))\n            .ok_or_else(|| {\n                anyhow!(\"MVCC logical pull offset is not a transaction boundary: {offset}\")\n            })\n    }\n}\n\nfn logical_log_path(db_path: &str) -> Result<PathBuf> {\n    Ok(db_file_path(db_path)?.with_extension(\"db-log\"))\n}\n\nfn is_in_memory_db_path(db_path: &str) -> bool {\n    db_path == \":memory:\"\n}\n\nfn db_file_path(db_path: &str) -> Result<PathBuf> {\n    if is_in_memory_db_path(db_path) {\n        return Err(anyhow!(\n            \"MVCC logical pull is not supported for in-memory sync server databases\"\n        ));\n    }\n    let path = if let Some(rest) = db_path.strip_prefix(\"file:\") {\n        rest.split_once('?').map_or(rest, |(path, _)| path)\n    } else {\n        db_path\n    };\n    Ok(PathBuf::from(path))\n}\n\nfn parse_mvcc_revision_offset(revision: &str, legacy_default: u64) -> Result<u64> {\n    if revision.is_empty() {\n        return Ok(0);\n    }\n    if let Some((generation, offset)) = revision.split_once(\":o\") {\n        let generation = generation\n            .strip_prefix('g')","sourceCodeStart":888,"sourceCodeEnd":924,"githubUrl":"https://github.com/tursodatabase/turso/blob/bad083fafbefdeae9a42ec19bdaaad8918dcf411/cli/sync_server.rs#L888-L924","documentation":"MVCC logical pulls stream bytes from the on-disk .db-log file derived from the server's db_path; an in-memory (\":memory:\") database has no such file, so db_file_path refuses early with this error. In the current server the error is intercepted in handle_logical_pull_updates, which logs and transparently downgrades the request to an incremental page pull, so clients normally never see it. It escapes only through new call sites of logical_log_path/db_file_path that lack the is_in_memory_db_path guard.","triggerScenarios":"Constructing TursoSyncServer with db_path=\":memory:\" (MVCC enabled) and code reaching logical_log_path directly instead of going through handle_logical_pull_updates' guarded path.","commonSituations":"Fast test loops that use an in-memory server database while MVCC sync features are enabled; new server code added without the in-memory guard.","solutions":["Use a file-backed database path when MVCC logical pulls must actually be exercised end to end.","Keep \":memory:\" and rely on the built-in page-pull fallback.","When adding code that opens the .db-log, mirror the existing guard: check is_in_memory_db_path(&self.db_path) before calling logical_log_path."],"exampleFix":"// before\nlet log_path = logical_log_path(&self.db_path)?;\n\n// after\nif is_in_memory_db_path(&self.db_path) {\n    return self.handle_page_pull_updates(req, PullUpdatesApplyMode::Incremental);\n}\nlet log_path = logical_log_path(&self.db_path)?;","handlingStrategy":"validation","validationCode":"fn supports_logical_pull(db_path: &str) -> bool {\n    !db_path.is_empty() && db_path != \":memory:\"\n}\n// before requesting stream_kind = MvccLogicalLog\nassert!(supports_logical_pull(&server_db_path), \"logical pulls need a file-backed db\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a file-backed database for the sync server when MVCC logical pulls must be exercised.","Check is_in_memory_db_path before any new code path that opens the .db-log, mirroring handle_logical_pull_updates."],"tags":["mvcc","in-memory","sync","configuration"],"backgroundTag":"in-memory-database-limitation","analyzedSha":"bad083fafbefdeae9a42ec19bdaaad8918dcf411","analyzedAt":"2026-08-16T23:12:11.798Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}