Expand description
Migration toolchain (export / import). See
migrate::run_export and migrate::run_import.
Migration toolchain: export / import.
Wire format = a RESP command stream of rebuild frames (SET / HSET /
RPUSH / SADD / ZADD / PEXPIREAT) — bidirectionally compatible with
redis-cli --pipe. Export walks SCAN cursors (per-key
point-in-time; SCAN-class consistency). Import pipelines 512
commands per batch with a fsynced progress file for --resume.
Every key’s frames start with DEL, so replay REBUILDS the key from
scratch — genuinely idempotent for every type (RPUSH would
otherwise append on re-import; the round-trip test caught exactly
that). No cross-batch atomicity to lose.
Structs§
- Export
- Run
export— walk the keyspace (optionally underprefix) and write rebuild frames toout_path. Returns exported key count. What an export did — including what it did NOT do. The skipped map is the half that used to be invisible: a type with no rebuild verb produced no frames, no error and no mention, so a migration could report success while leaving a whole type behind. - Import
Report - Import stats.
Functions§
- run_
export - Walk the keyspace (optionally under
prefix) and write rebuild frames toout_path, reporting both what went in and what could not. - run_
import - Run
import— streamsrc(a RESP command file) into the server,PIPELINEcommands per batch. The progress file<src>.progressrecords the safely-applied byte offset after every batch (fsynced);resumestarts there. Idempotent replay.