Trait MigrationSection
pub trait MigrationSection {
// Required methods
fn record(
&mut self,
id: &str,
) -> Result<Option<MigrationRecord>, WritePlaneError>;
fn data_checksum(
&mut self,
id: &str,
) -> Result<Option<String>, WritePlaneError>;
fn adopt_checksums(
&mut self,
id: &str,
opaque: Option<&str>,
content: &str,
) -> Result<(), WritePlaneError>;
fn resolve_run_id_cursor(
&mut self,
run_id: &str,
) -> Result<Option<String>, WritePlaneError>;
fn apply(
&mut self,
id: &str,
supplied_checksum: &str,
content_checksum: &str,
normalized: &[String],
identity_json: &str,
) -> Result<String, WritePlaneError>;
}Expand description
The migration-store view OneShotBackend::with_migration_barrier passes to its
closure. Reads carry NO decisions — the replay/adopt matrix over them is
execute_public_migration’s, the same compiled code on every host; every op executes
under the barrier’s exclusion span.
Required Methods§
fn record(
&mut self,
id: &str,
) -> Result<Option<MigrationRecord>, WritePlaneError>
fn record( &mut self, id: &str, ) -> Result<Option<MigrationRecord>, WritePlaneError>
Read the migrations-journal row for id, if the tag was already applied.
fn data_checksum(&mut self, id: &str) -> Result<Option<String>, WritePlaneError>
fn data_checksum(&mut self, id: &str) -> Result<Option<String>, WritePlaneError>
The recorded checksum of a DATA migration under id, if any — the kind-collision
probe behind MIGRATION_KIND_MISMATCH.
fn adopt_checksums(
&mut self,
id: &str,
opaque: Option<&str>,
content: &str,
) -> Result<(), WritePlaneError>
fn adopt_checksums( &mut self, id: &str, opaque: Option<&str>, content: &str, ) -> Result<(), WritePlaneError>
Backfill id’s stored checksums — the opaque one when the coordinator adopted it,
and the canonical content checksum — WITHOUT overwriting a present value (COALESCE
semantics). The barrier serializes same-tag racers, so plain COALESCE carries the
value; the coordinator’s matrix already carried the decision.
fn resolve_run_id_cursor(
&mut self,
run_id: &str,
) -> Result<Option<String>, WritePlaneError>
fn resolve_run_id_cursor( &mut self, run_id: &str, ) -> Result<Option<String>, WritePlaneError>
The legacy run_id → commit-cursor journal scan — the same scan
OneShotBackend::resolve_public_run_id_cursor wraps, run inside the section. The
C4 resolver spine drives it, with record as the
GC-race re-read leg.
fn apply(
&mut self,
id: &str,
supplied_checksum: &str,
content_checksum: &str,
normalized: &[String],
identity_json: &str,
) -> Result<String, WritePlaneError>
fn apply( &mut self, id: &str, supplied_checksum: &str, content_checksum: &str, normalized: &[String], identity_json: &str, ) -> Result<String, WritePlaneError>
Apply one fresh public DDL migration as its own atomic unit and return the committed
cursor. supplied_checksum is journaled as the opaque checksum; content_checksum
is coordinator-computed identity the host stores VERBATIM and never recomputes;
identity_json is the recorded statement vector (the caller’s original slots).
Contract (same as OneShotBackend::apply_public_ddl): every validation runs
INSIDE the transaction — the zero-capture MIGRATION_DDL_ONLY refusal, the
destructive-DDL (227) guards, schema-registry validation, the broken-foreign-keys
refusal — before the co-transactional journal insert and the commit.