Migration
Opening an older store with a newer build is allowed. Old files stay as they are and are read through their own revision paths. A background migrator then brings them to the current layout without stopping the store.
The migrator
Section titled “The migrator”A background thread named strata-migrate, or the command strata migrate (which uses all cores), picks local files whose per-file stamp is lower than the current stamp. It takes the deepest level first and the smallest file first. A file is described by its per-file stamp, recorded in MANIFEST tag 5.
Each stamp above the file’s own is a step. Two lists say what each step involves.
| List | Steps | Meaning |
|---|---|---|
VALUE_STEPS |
2 and 4 | Steps that involve the posting-block upgrade hook |
COLUMNAR_STEPS |
3 and 4 | Steps that involve the columnar block revisions |
For a file at stamp f, the migrator looks at every step in (f, current].
- If every step is a value step or a columnar step, the migration is scoped. The file is rewritten if either (a) some step is a columnar step and the file is columnar, or (b) some step is a value step and the file holds posting blocks the upgrade hook can pack. The rewrite is installed only if the output is at most 99 percent of the source size. Otherwise the file is relabelled: one MANIFEST edit removes and re-adds the same file id with the current stamp. A rewrite that came out larger than the limit is discarded and the file is relabelled.
- Otherwise the migration is a full rewrite at the same level with every MVCC version kept.
With the stamps that exist today, every range is scoped:
| File stamp | Steps ahead | Result |
|---|---|---|
| 1 | 2, 3, 4 | Scoped |
| 2 | 3, 4 | Scoped |
| 3 | 4 | Scoped |
| 4 | none | Nothing to do |
Safety
Section titled “Safety”- Outputs install through the
replaceoperation, so after a crash exactly one of the old and new file is live; orphans are removed by the startup sweep (SPEC V459). - Remote files are never force-migrated. They are rewritten only by tier rewrites (SPEC V460). See Remote files.
- The value upgrade hook (
format::set_value_upgrade) is applied to every put written bySstWriter::add, so ordinary flush and compaction also upgrade posting blocks (SPEC V653, V656).
What does not migrate
Section titled “What does not migrate”Derived caches are never migrated; they are ignored and rebuilt. Logical encodings such as row values and catalog extensions evolve additively and are never migrated either. See Compatibility rules.