{"record":{"id":"af32677d29180367","repo":"tursodatabase/turso","slug":"mvcc-logical-pull-offset-is-not-a-transaction-boun","errorCode":null,"errorMessage":"MVCC logical pull offset is not a transaction boundary: {offset}","messagePattern":"MVCC logical pull offset is not a transaction boundary: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"cli/sync_server.rs","lineNumber":1006,"sourceCode":"\nstruct HttpResponse {\n    status: u16,\n    content_type: String,\n    body: Vec<u8>,\n}\n\nstruct MvccLogSnapshot {\n    end_offset: u64,\n    crc_by_offset: Vec<(u64, u32)>,\n}\n\nimpl MvccLogSnapshot {\n    fn crc_seed_at(&self, offset: u64) -> Result<u32> {\n        self.crc_by_offset\n            .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    }","sourceCodeStart":988,"sourceCodeEnd":1024,"githubUrl":"https://github.com/tursodatabase/turso/blob/492c4a71cd7c2649e7df83da1471b74f4b1c7aa9/cli/sync_server.rs#L988-L1024","documentation":"The MVCC logical-log snapshot records CRC seeds only at transaction boundaries (commits). crc_seed_at was asked for an offset that is not in that boundary list, so the client tried to resume from a byte position in the middle of a transaction's frames, where no consistent resume point exists.","triggerScenarios":"Client resumes a logical pull with an offset it computed itself (e.g. byte-count arithmetic on previous responses) instead of a server-returned revision; or an offset from a different log generation whose boundary layout differs.","commonSituations":"Custom sync clients storing raw byte offsets rather than echoing the server's revision string; the .db-log rewritten between pulls so old boundaries no longer line up.","solutions":["Only resume from revision strings the server returned in previous pull responses","If no known-good boundary remains, re-bootstrap with a full pull from offset 0","Never derive offsets by arithmetic on log sizes or response lengths"],"exampleFix":"// before\nlet offset = last_response_body_len + prev_offset; // invented offset\nreq.client_revision = format!(\"g1:o{offset}\");\n\n// after\nreq.client_revision = server_returned_revision; // e.g. \"g1:o4096\" echoed back","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"match pull_logical(stored_revision).await {\n    Ok(resp) => resp,\n    Err(e) if e.to_string().contains(\"not a transaction boundary\") => {\n        bootstrap_full_snapshot().await?; // or pull from offset \"g1:o0\"\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Persist and reuse only revision strings returned by the server","Never compute offsets from response sizes or log arithmetic","Tag stored revisions with the server identity so state from one server is never replayed at another"],"tags":["mvcc","logical-pull","crc","resume-offset","sync-server"],"backgroundTag":"invalid-resume-offset","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"}