{"record":{"id":"a5806fdfb3014a83","repo":"risingwavelabs/risingwave","slug":"require-sql-meta-store","errorCode":null,"errorMessage":"require SQL meta store","messagePattern":"require SQL meta store","errorType":"exception","errorClass":"TimeTravel","httpStatus":null,"severity":"error","filePath":"src/meta/src/hummock/manager/time_travel.rs","lineNumber":870,"sourceCode":"            \"unexpected time travel delta {:?}\",\n            d\n        );\n        if d.prev_id < last_version.id {\n            return Err(Error::TimeTravel(anyhow!(format!(\n                \"invalid time travel delta chain: delta {} has prev version {}, but replay has reached {}\",\n                d.id, d.prev_id, last_version.id\n            ))));\n        }\n        // Compaction deltas are not included in the time travel archive, so there may be gaps\n        // between the last replayed version and this delta's previous version.\n        last_version.id = d.prev_id;\n        last_version.apply_version_delta(&d);\n    }\n    Ok(last_version)\n}\n\npub fn require_sql_meta_store_err() -> Error {\n    Error::TimeTravel(anyhow!(\"require SQL meta store\"))\n}\n\n/// Time travel delta replay only expect `NewL0SubLevel`. In all other cases, a new version snapshot should be created.\npub fn should_mark_next_time_travel_version_snapshot(delta: &HummockVersionDelta) -> bool {\n    delta.group_deltas.iter().any(|(_, deltas)| {\n        deltas\n            .group_deltas\n            .iter()\n            .any(|d| !matches!(d, GroupDeltaCommon::NewL0SubLevel(_)))\n    })\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    fn version(id: u64) -> PbHummockVersion {\n        let mut version = HummockVersion::default();","sourceCodeStart":852,"sourceCodeEnd":888,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/hummock/manager/time_travel.rs#L852-L888","documentation":"Time-travel version archival/replay features require a SQL-backed meta store (e.g. PostgreSQL); the in-memory meta store cannot persist time-travel archives. require_sql_meta_store_err returns this Error::TimeTravel whenever a time-travel operation is invoked against a non-SQL store.","triggerScenarios":"Calling any time-travel query/archive API (e.g. epoch_to_version paths) when the meta store backend is in-memory rather than SQL.","commonSituations":"Running RisingWave in dev/test with the default in-memory meta backend and then attempting point-in-time queries; docker setups without --meta-store configured to SQL (PostgreSQL/MySQL).","solutions":["Start the cluster with a SQL meta store, e.g. --meta-store postgres (or mysql) with connection details configured.","If the in-memory store is intentional, avoid time-travel queries/features on that deployment.","Guard feature enablement on Env::meta_store_type being SQL before invoking time-travel APIs."],"exampleFix":"// before: time travel on default in-memory meta store fails\nrise CTL \"SELECT * FROM t FOR TIMESTAMP AS OF '2024-01-01'\";\n// after: start meta node with SQL backend\n./risedev d # with meta-backend: postgresql in risedev profile\n-- or: risingwave meta-node --meta-store postgresql --postgres-host ... ","handlingStrategy":"validation","validationCode":"// Rust: check backend before invoking time travel\nif env.meta_store_type() != MetaStoreType::Sql {\n    return Err(\"time travel requires a SQL meta store\".into());\n}","typeGuard":null,"tryCatchPattern":"match time_travel_query(...).await {\n    Err(e) if e.to_string().contains(\"require SQL meta store\") =>\n        eprintln!(\"Start the cluster with --meta-store postgres to use time travel\"),\n    other => other?,\n}","preventionTips":["Provision PostgreSQL/MySQL meta store for any cluster using time travel.","Document that in-memory meta store is dev-only and lacks time travel.","Gate time-travel UI/queries on backend capability."],"tags":["rust","meta-service","time-travel","storage-backend","configuration"],"backgroundTag":"unsupported-operation","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}