{"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":1022,"sourceCode":"            .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')\n            .ok_or_else(|| anyhow!(\"invalid MVCC pull revision generation: {revision}\"))?","sourceCodeStart":1004,"sourceCodeEnd":1040,"githubUrl":"https://github.com/tursodatabase/turso/blob/492c4a71cd7c2649e7df83da1471b74f4b1c7aa9/cli/sync_server.rs#L1004-L1040","documentation":"MVCC logical pulls need the on-disk logical log, whose path is derived from the database path by swapping the extension to .db-log via db_file_path. A ':memory:' database has no file, so db_file_path refuses outright. The main logical-pull handler degrades this case to incremental page pulls, so seeing the raw error means a code path that needed the log file with no fallback applied.","triggerScenarios":"Starting the sync server with db_path = \":memory:\" and reaching logic that calls logical_log_path/db_file_path outside the page-pull fallback (e.g. replace-base or log-scan paths).","commonSituations":"Using :memory: for fast tests and then exercising MVCC/sync code paths; harness defaults resolving the db path to :memory: while sync tests assume file-backed storage.","solutions":["Run the sync server with a file-backed database path (e.g. sync.db) when MVCC logical sync is in play","For tests, use a temp-file database instead of :memory:","Keep the page-pull fallback path intact if you modify the server so in-memory mode still serves pages"],"exampleFix":"// before\ntursodb sync-server --db :memory:\n\n// after\ntursodb sync-server --db /tmp/sync-test/sync.db","handlingStrategy":"validation","validationCode":"// startup guard for the sync server\nif db_path == \":memory:\" && logical_pulls_enabled {\n    return Err(anyhow!(\"MVCC logical pull requires a file-backed database path\"));\n}","typeGuard":"fn is_in_memory_db_path(p: &str) -> bool {\n    p == \":memory:\"\n}","tryCatchPattern":null,"preventionTips":["Use a temp-file database in tests that exercise MVCC logical sync","Fail fast at startup when configuration combines :memory: with sync features"],"tags":["sync-server","in-memory-database","mvcc","logical-pull"],"backgroundTag":"unsupported-in-memory-database","analyzedSha":"492c4a71cd7c2649e7df83da1471b74f4b1c7aa9","analyzedAt":"2026-08-20T07:02:18.389Z","contentChangedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}