FAILURE MAP
← Case archive

FA-571 / Replication / Open access

Promote a bootstrapped replica: A snapshot from another cluster is installed · case 01

The replica bootstrap operation is admitted even though a snapshot from another cluster is installed.

Verified by executionVariant 1 · 9 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The admission path omits the cluster identity invariant while validating the other operation preconditions.

VERIFIED REPAIR

Require r['cluster_identity'][0] == r['cluster_identity'][1] together with every other stated precondition before accepting the operation.

Unsuccessful approach: Adding the cluster identity check repairs the reported defect, but replacing the adjacent snapshot ready 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['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])
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 fixtureActualExpectedOutcome
valid operationTrueTruePassed
A replica serves before loading its baseline snapshotFalseFalsePassed
The retained log starts after the snapshot successorFalseFalsePassed
Promotion occurs before replay reaches the required watermarkFalseFalsePassed
A replica interprets log records with an unsupported schemaFalseFalsePassed
A snapshot from another cluster is installedTrueFalseFailed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / a5bca44cc0fa277102757a71ef711f59e6a14bb362fb3e23d113eef53d820614

2 / The unsuccessful fix

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 fixtureActualExpectedOutcome
valid operationTrueTruePassed
A replica serves before loading its baseline snapshotTrueFalseFailed
The retained log starts after the snapshot successorFalseFalsePassed
Promotion occurs before replay reaches the required watermarkFalseFalsePassed
A replica interprets log records with an unsupported schemaFalseFalsePassed
A snapshot from another cluster is installedFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

SHA-256 / 17d6dfa9ec23d230f75240dbcd9a9478bcbc34a6ec5fdf840ac7f7a8af4a40c7

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 fixtureActualExpectedOutcome
valid operationTrueTruePassed
A replica serves before loading its baseline snapshotFalseFalsePassed
The retained log starts after the snapshot successorFalseFalsePassed
Promotion occurs before replay reaches the required watermarkFalseFalsePassed
A replica interprets log records with an unsupported schemaFalseFalsePassed
A snapshot from another cluster is installedFalseFalsePassed
unrelated tracing metadataTrueTruePassed
repeat validation is pureTrueTruePassed
two independent violations in variantFalseFalsePassed

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:54.234400+00:00.

Case digest / f55cd485f66ec89f2f17a86696236e68ec5ef6edbd77044c207c456db4b40eda