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

  1. Re-bootstrap the client with a full snapshot pull so it obtains a fresh g1 revision
  2. Keep the server's .db-log stable (no deletions/resets) while clients are actively syncing
  3. 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

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


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)