REPLICATION_READINESS.md¶
AeroDB — Phase 2 Replication Readiness Checklist¶
Status¶
- This document tracks replication implementation completeness
- All items must be verified before replication is production-ready
- Semantic freeze is enforced
1. Semantic Freeze Declaration¶
Phase-1 semantics are FROZEN.
MVCC semantics are FROZEN.
Replication CONSUMES existing correctness. Any deviation is a correctness bug.
2. Core Implementation Status¶
REPLICATION-01: Roles & Authority ✅¶
- ReplicationRole (Primary, Replica)
- ReplicationState state machine
- HaltReason enumeration
- Authority enforcement (write admission, commit authority)
- Dual-primary detection
REPLICATION-02: WAL Shipping ✅¶
- WalPosition tracking
- WalSender (Primary-side)
- WalReceiver (Replica-side)
- Prefix validation (Replica_WAL == Prefix(Primary_WAL))
- Gap detection → ReplicationHalted
REPLICATION-03: Snapshot Transfer ✅¶
- SnapshotMetadata
- SnapshotReceiver lifecycle
- Eligibility checks (Primary-only, complete, validated)
- Atomic installation
- WAL resume after boundary
REPLICATION-04: Replica Reads ✅¶
- ReadEligibility enum
- ReplicaReadAdmission
- Boundary check: R.read_upper_bound ≤ C_replica
- Refusal paths (halted, gap, snapshot, recovery)
REPLICATION-05: Failure Matrix ✅¶
- ReplicationCrashPoint enumeration
- FailureOutcome mapping
- FailureState tracking
- All crash points from FAILURE_MATRIX.md
REPLICATION-06: Recovery ✅¶
- PrimaryRecovery (WAL/MVCC verification)
- ReplicaRecovery (prefix/snapshot verification)
- RecoveryValidation enum
- Halt on uncertainty
REPLICATION-07: Compatibility ✅¶
- Phase1Compatibility assertions
- MvccCompatibility assertions
- CompatibilityCheck verification
3. Test Coverage¶
| Module | Tests |
|---|---|
| role | 9 |
| authority | 8 |
| errors | 2 |
| wal_sender | 5 |
| wal_receiver | 7 |
| snapshot_transfer | 8 |
| replica_reads | 10 |
| failure_matrix | 9 |
| recovery | 10 |
| compatibility | 6 |
Total: 74+ replication tests
4. Phase-1 Compatibility Guarantees¶
Per REPLICATION_COMPATIBILITY.md §2:
- WAL remains sole durability authority
- fsync semantics unchanged
- WAL replay rules identical
- Storage invariants intact
- Query engine unchanged
5. MVCC Compatibility Guarantees¶
Per REPLICATION_COMPATIBILITY.md §3:
- CommitIds globally ordered
- CommitIds immutable
- CommitIds only from Primary
- Visibility semantics unchanged
- GC rules unchanged
6. Invariant Summary¶
From REPLICATION_INVARIANTS.md:
| # | Invariant | Status |
|---|---|---|
| 1 | Single-Writer | ✅ Enforced |
| 2 | Commit Authority | ✅ Enforced |
| 3 | Prefix Validity | ✅ Enforced |
| 4 | Gap Detection | ✅ Enforced |
| 5 | Fail-Stop | ✅ Enforced |
7. Readiness Certification¶
- All REPLICATION-01 through REPLICATION-07 implemented
- All tests pass
- Phase-1 semantics preserved
- MVCC semantics preserved
- Fail-stop on uncertainty
Replication adds nodes, not meanings.