Skip to main content

Module migrate

Module migrate 

Source
Expand description

Engine upgrade duties of the first 3.12 start (SPEC-ENGINE §3.16, V13.E1), from a 3.11.5 or a 3.12.0-rc data directory.

Two phases, each run once and recorded in <data>/cloud/upgrade-3.12.json:

  • local (first start, offline): rc-era replicas without user_version = 1 are deleted (the next sync clones them again); drafts/<stable>.watermark moves to capture/<place>.watermark; queued session drafts are recaptured through the gate (the old ones are dropped, what passes is queued again).
  • C0 2.0 (first start against a Cloud that speaks 2.0): the 1.x relay cursors are dropped (channels became places), the agent-keyed presence map is discarded (presence is keyed by worker id), and the facts that 1.x pulls copied in from a vault that now has a replica are removed, their local relations rewritten to the replica node (retire_pulled).

The auto_draft → auto_capture rename is a config alias (core::config::renamed), applied on load and rewritten on write. cloud status prints the counts once (status_lines_once).

Structs§

Retired
What retire_pulled did in one checkout.
UpgradeReport
What the upgrade did, summed over both phases.

Constants§

REPLICA_NODE_CATEGORY
Category of a local relation endpoint that is a replica node: vault:<vault_id> / <node_id>.

Functions§

replica_node_ref
The relation endpoint of node node_id in the replica of vault_id.
retire_on_clone
retire_pulled right after a vault’s first clone; its counts go to the upgrade report cloud status prints once. Returns the facts removed.
retire_pulled
Remove the facts 1.x pulls copied from record’s vault into the knowledge of the checkout at root (the replica serves them now) and rewrite the local relations that pointed at them to the replica node of the same claim: the keyed exact dedupe key of its node type and normalised statement (§3.1.5), never a recomputed fact_id. A relation whose claim has no live replica node is dropped and counted.
run
Run the upgrade phases not done yet. Cheap once both are done.
status_lines_once
cloud status lines about the upgrade, once: empty until a later phase changes the counts.