tursodatabase/turso · error

MVCC logical pull is not supported for in-memory sync…

Error message

MVCC logical pull is not supported for in-memory sync server databases

What it means

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.

Solutions

  1. Run the sync server with a file-backed database path (e.g. sync.db) when MVCC logical sync is in play
  2. For tests, use a temp-file database instead of :memory:
  3. Keep the page-pull fallback path intact if you modify the server so in-memory mode still serves pages

Example fix

// before
tursodb sync-server --db :memory:

// after
tursodb sync-server --db /tmp/sync-test/sync.db
Defensive patterns

Strategy: validation

Validate before calling

// startup guard for the sync server
if db_path == ":memory:" && logical_pulls_enabled {
    return Err(anyhow!("MVCC logical pull requires a file-backed database path"));
}

Type guard

fn is_in_memory_db_path(p: &str) -> bool {
    p == ":memory:"
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of tursodatabase/turso@492c4a71cd (2026-08-20). Data as JSON: /api/errors/91a2b97877b0edb3. Report an issue: GitHub.

Appendix: source

Thrown at cli/sync_server.rs:1022

            .find_map(|(boundary, crc)| (*boundary == offset).then_some(*crc))
            .ok_or_else(|| {
                anyhow!("MVCC logical pull offset is not a transaction boundary: {offset}")
            })
    }
}

fn logical_log_path(db_path: &str) -> Result<PathBuf> {
    Ok(db_file_path(db_path)?.with_extension("db-log"))
}

fn is_in_memory_db_path(db_path: &str) -> bool {
    db_path == ":memory:"
}

fn db_file_path(db_path: &str) -> Result<PathBuf> {
    if is_in_memory_db_path(db_path) {
        return Err(anyhow!(
            "MVCC logical pull is not supported for in-memory sync server databases"
        ));
    }
    let path = if let Some(rest) = db_path.strip_prefix("file:") {
        rest.split_once('?').map_or(rest, |(path, _)| path)
    } 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}"))?

View on GitHub (pinned to 492c4a71cd)