FA-551 / Replication / Open access
Promote a bootstrapped replica: A replica serves before loading its baseline snapshot · case 01
The replica bootstrap operation is admitted even though a replica serves before loading its baseline snapshot.
ROOT CAUSE
The admission path omits the snapshot ready invariant while validating the other operation preconditions.
VERIFIED REPAIR
Require r['snapshot_ready'] is True together with every other stated precondition before accepting the operation.
Unsuccessful approach: Adding the snapshot ready check repairs the reported defect, but replacing the adjacent wal bridge check loses that independent invariant.
Case contract
Return a Boolean admission decision for promote a bootstrapped replica. The record r must satisfy all of: r['snapshot_ready'] is True; r['wal_bridge'][0] <= r['wal_bridge'][1]+1; r['replay_floor'][0] >= r['replay_floor'][1]; r['schema_compatible'][0] in r['schema_compatible'][1]; r['cluster_identity'][0] == r['cluster_identity'][1]. Extra tracing fields are ignored; validation does not mutate the record.
Why this case matters
A deterministic local contract for replication. Each negative fixture violates exactly one invariant. No transport timing, persistence, cryptographic verification, or full protocol implementation is claimed.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['wal_bridge'][0] <= r['wal_bridge'][1]+1) and (r['replay_floor'][0] >= r['replay_floor'][1]) and (r['schema_compatible'][0] in r['schema_compatible'][1]) and (r['cluster_identity'][0] == r['cluster_identity'][1])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'snapshot_ready': True, 'wal_bridge': [11, 10], 'replay_floor': [20, 20], 'schema_compatible': [3, [2, 3]], 'cluster_identity': ['east', 'east']}
check('valid operation', solve(r), True)
check('A replica serves before loading its baseline snapshot', solve(dict(r, **{'snapshot_ready': False})), False)
check('The retained log starts after the snapshot successor', solve(dict(r, **{'wal_bridge': [12, 10]})), False)
check('Promotion occurs before replay reaches the required watermark', solve(dict(r, **{'replay_floor': [19, 20]})), False)
check('A replica interprets log records with an unsupported schema', solve(dict(r, **{'schema_compatible': [4, [2, 3]]})), False)
check('A snapshot from another cluster is installed', solve(dict(r, **{'cluster_identity': ['west', 'east']})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'snapshot_ready': False, 'wal_bridge': [12, 10], 'replay_floor': [19, 20], 'schema_compatible': [4, [2, 3]], 'cluster_identity': ['west', 'east']}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| A replica serves before loading its baseline snapshot | True | False | Failed |
| The retained log starts after the snapshot successor | False | False | Passed |
| Promotion occurs before replay reaches the required watermark | False | False | Passed |
| A replica interprets log records with an unsupported schema | False | False | Passed |
| A snapshot from another cluster is installed | False | False | Passed |
| unrelated tracing metadata | True | True | Passed |
| repeat validation is pure | True | True | Passed |
| two independent violations in variant | False | False | Passed |
SHA-256 / 17d6dfa9ec23d230f75240dbcd9a9478bcbc34a6ec5fdf840ac7f7a8af4a40c7
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['snapshot_ready'] is True) and (r['replay_floor'][0] >= r['replay_floor'][1]) and (r['schema_compatible'][0] in r['schema_compatible'][1]) and (r['cluster_identity'][0] == r['cluster_identity'][1])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'snapshot_ready': True, 'wal_bridge': [11, 10], 'replay_floor': [20, 20], 'schema_compatible': [3, [2, 3]], 'cluster_identity': ['east', 'east']}
check('valid operation', solve(r), True)
check('A replica serves before loading its baseline snapshot', solve(dict(r, **{'snapshot_ready': False})), False)
check('The retained log starts after the snapshot successor', solve(dict(r, **{'wal_bridge': [12, 10]})), False)
check('Promotion occurs before replay reaches the required watermark', solve(dict(r, **{'replay_floor': [19, 20]})), False)
check('A replica interprets log records with an unsupported schema', solve(dict(r, **{'schema_compatible': [4, [2, 3]]})), False)
check('A snapshot from another cluster is installed', solve(dict(r, **{'cluster_identity': ['west', 'east']})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'snapshot_ready': False, 'wal_bridge': [12, 10], 'replay_floor': [19, 20], 'schema_compatible': [4, [2, 3]], 'cluster_identity': ['west', 'east']}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| A replica serves before loading its baseline snapshot | False | False | Passed |
| The retained log starts after the snapshot successor | True | False | Failed |
| Promotion occurs before replay reaches the required watermark | False | False | Passed |
| A replica interprets log records with an unsupported schema | False | False | Passed |
| A snapshot from another cluster is installed | False | False | Passed |
| unrelated tracing metadata | True | True | Passed |
| repeat validation is pure | True | True | Passed |
| two independent violations in variant | False | False | Passed |
SHA-256 / 4ed7daccdf80981822d38771a16d7f821cfe893106b1c5bff0dcbcd5a1aa5553
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(r):
return (r['snapshot_ready'] is True) and (r['wal_bridge'][0] <= r['wal_bridge'][1]+1) and (r['replay_floor'][0] >= r['replay_floor'][1]) and (r['schema_compatible'][0] in r['schema_compatible'][1]) and (r['cluster_identity'][0] == r['cluster_identity'][1])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
r = {'snapshot_ready': True, 'wal_bridge': [11, 10], 'replay_floor': [20, 20], 'schema_compatible': [3, [2, 3]], 'cluster_identity': ['east', 'east']}
check('valid operation', solve(r), True)
check('A replica serves before loading its baseline snapshot', solve(dict(r, **{'snapshot_ready': False})), False)
check('The retained log starts after the snapshot successor', solve(dict(r, **{'wal_bridge': [12, 10]})), False)
check('Promotion occurs before replay reaches the required watermark', solve(dict(r, **{'replay_floor': [19, 20]})), False)
check('A replica interprets log records with an unsupported schema', solve(dict(r, **{'schema_compatible': [4, [2, 3]]})), False)
check('A snapshot from another cluster is installed', solve(dict(r, **{'cluster_identity': ['west', 'east']})), False)
check('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)
check('repeat validation is pure', solve(r), True)
invalid = {'snapshot_ready': False, 'wal_bridge': [12, 10], 'replay_floor': [19, 20], 'schema_compatible': [4, [2, 3]], 'cluster_identity': ['west', 'east']}
keys = list(invalid)
pair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}
check('two independent violations in variant', solve(dict(r, **pair)), False)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| valid operation | True | True | Passed |
| A replica serves before loading its baseline snapshot | False | False | Passed |
| The retained log starts after the snapshot successor | False | False | Passed |
| Promotion occurs before replay reaches the required watermark | False | False | Passed |
| A replica interprets log records with an unsupported schema | False | False | Passed |
| A snapshot from another cluster is installed | False | False | Passed |
| unrelated tracing metadata | True | True | Passed |
| repeat validation is pure | True | True | Passed |
| two independent violations in variant | False | False | Passed |
SHA-256 / f50e1762ced7132aae48370c870710e99da7f1d9bd2ed40f6ef19cc2d1a465cf
Verification & scope
This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:36:53.842459+00:00.
Case digest / a98353f2d7ab8bc1879b39bfd563ea8312863a72a3f0a9d312a4694ce3d3bdfc