Extends the DatabaseBackup trait and cross-key boot tests introduced in
#6332 to cover MemoryDatabase and ScyllaDbDatabase in addition to RocksDB.
linera-views:
- MemoryDatabase: backup serializes all root-key partitions to
memory_backup.bcs (BCS-encoded BTreeMap<root_key, BTreeMap<k, v>>).
- ScyllaDbDatabaseInternal: full-table SELECT scan written to
scylladb_backup.bcs in the same format; uses a fresh thread +
current_thread Tokio runtime to bridge the sync trait into async CQL.
- JournalingKeyValueDatabase<D>: added DatabaseBackup forwarding impl to
complete the ScyllaDB wrapper chain.
- DatabaseBackup doc comment updated to be backend-agnostic.
linera-core:
- Backup test module now compiled under #[cfg(test)] (was rocksdb-only),
with per-backend #[cfg(feature)] guards inside the file.
- 9 tests total: 3 scenarios x 3 backends (memory, rocksdb, scylladb).
- Memory restore: BCS deserialize + open_shared + write_batch.
- ScyllaDB restore: same BCS format, strips get_big_root_key prefix byte,
re-inserts via ScyllaDbDatabaseInternal::open_shared + write_batch.
Motivation
Phase 0a (#6332) verified that a
WorkerStatecan boot from a RocksDB backup produced by a different validator. This follow-up extends theDatabaseBackuptrait and cross-key boot tests to theMemoryDatabaseandScyllaDbDatabasebackends.Proposal
linera-viewschanges:DatabaseBackupforMemoryDatabase: BCS-serializes all root-key partitions tomemory_backup.bcs(BTreeMap<root_key, BTreeMap<k, v>>).DatabaseBackupforScyllaDbDatabaseInternal: full-tableSELECT root_key, k, vscan written toscylladb_backup.bcsin the same format. Uses a fresh thread +current_threadTokio runtime to bridge the sync trait into async CQL without nesting runtimes.DatabaseBackupforwarding impl forJournalingKeyValueDatabase<D>— fills the missing link in the ScyllaDB wrapper chain (LruCachingDatabase → ValueSplittingDatabase → JournalingKeyValueDatabase → ScyllaDbDatabaseInternal).DatabaseBackupdoc comment updated to be backend-agnostic.linera-corechanges:#[cfg(test)](wasrocksdb-only), with per-backend#[cfg(feature = "...")]guards inside the file.open_shared+write_batch.get_big_root_keyleading byte to recover the logical root key, re-inserts viaScyllaDbDatabaseInternal::open_shared+write_batch.Test Plan
cargo test --package linera-core --features test worker_backup_tests— pass.cargo test --package linera-core --features test,rocksdb worker_backup_tests— pass.scylladb.ymlCI workflow (Dockerscylladb/scylla:6.1).cargo clippyclean on all three feature combinations (test,test,rocksdb,test,rocksdb,scylladb).Release Plan
Links