tursodatabase/turso · error
sync_server supports only single-generation MVCC logical…
Error message
sync_server supports only single-generation MVCC logical pulls: {revision} What it means
The revision parsed cleanly but its generation is not 1 (e.g. g2:o10). The generation counter increments when the MVCC logical log is reset or rotated; this test server serves only a single-generation log and refuses cross-generation pulls because old generations' offsets are meaningless against the current log.
Solutions
- Re-bootstrap the client with a full snapshot pull so it obtains a fresh g1 revision
- Keep the server's .db-log stable (no deletions/resets) while clients are actively syncing
- If you control the server, implement multi-generation logical pulls instead of relying on this test server
Example fix
// before: reuse g2 revision after server log reset
client.set_revision("g2:o1048576");
// after: re-bootstrap on generation mismatch
if err.contains("single-generation") {
client.bootstrap_full_snapshot().await?; // yields fresh "g1:oN"
} Defensive patterns
Strategy: fallback
Try / catch
match pull_logical(&client_revision).await {
Ok(resp) => resp,
Err(e) if e.to_string().contains("single-generation") => {
bootstrap_full_snapshot().await?; // resets client to a fresh g1 revision
}
Err(e) => return Err(e),
} Prevention
- Do not delete or reset the server's .db-log while clients hold sync state
- Treat any server-side log reset as a trigger to re-bootstrap all clients
- Store the generation alongside the offset in client state so mismatches are detectable locally
When it happens
Trigger: A client that synced through a log rotation on another server (or an earlier incarnation of this one) presents a g2+ revision to POST /pull-updates with the logical stream kind.
Common situations: Server .db-log deleted or reset while clients kept sync state; moving a client between servers with different generation histories; testing log-rotation flows against this single-generation server.
Related errors
- invalid MVCC pull revision generation
- invalid MVCC pull revision generation
- invalid MVCC pull revision offset
- buffer too short for u32 at offset
- buffer too short for u64 at offset
AI-assisted analysis of tursodatabase/turso@492c4a71cd (2026-08-20).
Data as JSON: /api/errors/ad77756caad07a04.
Report an issue: GitHub.
Appendix: source
Thrown at cli/sync_server.rs:1045
} else {
db_path
};
Ok(PathBuf::from(path))
}
fn parse_mvcc_revision_offset(revision: &str, legacy_default: u64) -> Result<u64> {
if revision.is_empty() {
return Ok(0);
}
if let Some((generation, offset)) = revision.split_once(":o") {
let generation = generation
.strip_prefix('g')
.ok_or_else(|| anyhow!("invalid MVCC pull revision generation: {revision}"))?
.parse::<u64>()
.map_err(|err| anyhow!("invalid MVCC pull revision generation: {revision}: {err}"))?;
if generation != 1 {
return Err(anyhow!(
"sync_server supports only single-generation MVCC logical pulls: {revision}"
));
}
return offset
.parse::<u64>()
.map_err(|err| anyhow!("invalid MVCC pull revision offset: {revision}: {err}"));
}
// Older page bootstrap responses from this test server used WAL frame
// numbers. Treat them as "the page snapshot already includes the current
// logical log" so the required follow-up logical pull becomes a no-op.
Ok(legacy_default)
}
fn scan_mvcc_log(log: &[u8]) -> Result<MvccLogSnapshot> {
if log.is_empty() {
return Ok(MvccLogSnapshot {
end_offset: 0,
crc_by_offset: vec![(0, 0)],
});View on GitHub (pinned to 492c4a71cd)