{"abstract":"The failover promote operation is admitted even though a read-only standby is advertised as write primary.","category":"Reliability","checks":9,"contract":"Return a Boolean admission decision for promote a standby after primary failure. The record r must satisfy all of: r['primary_fenced'] is True; r['rpo_bound'][0]-r['rpo_bound'][1] <= r['rpo_bound'][2]; r['standby_writable'] is True; r['promotion_epoch'][0] > r['promotion_epoch'][1]; r['routing_switched'][0] == r['routing_switched'][1]. Extra tracing fields are ignored; validation does not mutate the record.","evaluation_group":"xd-failover-promote","failed_approach":"Adding the standby writable check repairs the reported defect, but replacing the adjacent promotion epoch check loses that independent invariant.","family":"xd-failover-promote-standby_writable","id":"FA-1086","implementations":{"attempt":{"sha256":"6a545fa2ceb0418f818b5fb5f27a1989856606adafbcaf2668947b2208d1af49","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(r):\n    return (r['primary_fenced'] is True) and (r['rpo_bound'][0]-r['rpo_bound'][1] <= r['rpo_bound'][2]) and (r['standby_writable'] is True) and (r['routing_switched'][0] == r['routing_switched'][1])\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nr = {'primary_fenced': True, 'rpo_bound': [10, 9, 1], 'standby_writable': True, 'promotion_epoch': [6, 5], 'routing_switched': ['new', 'new']}\ncheck('valid operation', solve(r), True)\ncheck('Promotion permits two writable primaries', solve(dict(r, **{'primary_fenced': False})), False)\ncheck('Standby lag exceeds the declared data-loss allowance', solve(dict(r, **{'rpo_bound': [10, 8, 1]})), False)\ncheck('A read-only standby is advertised as write primary', solve(dict(r, **{'standby_writable': False})), False)\ncheck('A delayed promotion reverses a newer failover', solve(dict(r, **{'promotion_epoch': [5, 5]})), False)\ncheck('Promotion succeeds while writes still route to the old primary', solve(dict(r, **{'routing_switched': ['old', 'new']})), False)\ncheck('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)\ncheck('repeat validation is pure', solve(r), True)\ninvalid = {'primary_fenced': False, 'rpo_bound': [10, 8, 1], 'standby_writable': False, 'promotion_epoch': [5, 5], 'routing_switched': ['old', 'new']}\nkeys = list(invalid)\npair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}\ncheck('two independent violations in variant', solve(dict(r, **pair)), False)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"ee4cce68b9bff2a6c33625b9efd9ab8e345b2814f2c1d215d12912e1494b67f7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(r):\n    return (r['primary_fenced'] is True) and (r['rpo_bound'][0]-r['rpo_bound'][1] <= r['rpo_bound'][2]) and (r['promotion_epoch'][0] > r['promotion_epoch'][1]) and (r['routing_switched'][0] == r['routing_switched'][1])\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nr = {'primary_fenced': True, 'rpo_bound': [10, 9, 1], 'standby_writable': True, 'promotion_epoch': [6, 5], 'routing_switched': ['new', 'new']}\ncheck('valid operation', solve(r), True)\ncheck('Promotion permits two writable primaries', solve(dict(r, **{'primary_fenced': False})), False)\ncheck('Standby lag exceeds the declared data-loss allowance', solve(dict(r, **{'rpo_bound': [10, 8, 1]})), False)\ncheck('A read-only standby is advertised as write primary', solve(dict(r, **{'standby_writable': False})), False)\ncheck('A delayed promotion reverses a newer failover', solve(dict(r, **{'promotion_epoch': [5, 5]})), False)\ncheck('Promotion succeeds while writes still route to the old primary', solve(dict(r, **{'routing_switched': ['old', 'new']})), False)\ncheck('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)\ncheck('repeat validation is pure', solve(r), True)\ninvalid = {'primary_fenced': False, 'rpo_bound': [10, 8, 1], 'standby_writable': False, 'promotion_epoch': [5, 5], 'routing_switched': ['old', 'new']}\nkeys = list(invalid)\npair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}\ncheck('two independent violations in variant', solve(dict(r, **pair)), False)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"4d5271ee2d95b6384e0ebb8d873ed589261c47bd05cf7abcb05be97b66331b75","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(r):\n    return (r['primary_fenced'] is True) and (r['rpo_bound'][0]-r['rpo_bound'][1] <= r['rpo_bound'][2]) and (r['standby_writable'] is True) and (r['promotion_epoch'][0] > r['promotion_epoch'][1]) and (r['routing_switched'][0] == r['routing_switched'][1])\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nr = {'primary_fenced': True, 'rpo_bound': [10, 9, 1], 'standby_writable': True, 'promotion_epoch': [6, 5], 'routing_switched': ['new', 'new']}\ncheck('valid operation', solve(r), True)\ncheck('Promotion permits two writable primaries', solve(dict(r, **{'primary_fenced': False})), False)\ncheck('Standby lag exceeds the declared data-loss allowance', solve(dict(r, **{'rpo_bound': [10, 8, 1]})), False)\ncheck('A read-only standby is advertised as write primary', solve(dict(r, **{'standby_writable': False})), False)\ncheck('A delayed promotion reverses a newer failover', solve(dict(r, **{'promotion_epoch': [5, 5]})), False)\ncheck('Promotion succeeds while writes still route to the old primary', solve(dict(r, **{'routing_switched': ['old', 'new']})), False)\ncheck('unrelated tracing metadata', solve(dict(r, trace='run-'+str(N))), True)\ncheck('repeat validation is pure', solve(r), True)\ninvalid = {'primary_fenced': False, 'rpo_bound': [10, 8, 1], 'standby_writable': False, 'promotion_epoch': [5, 5], 'routing_switched': ['old', 'new']}\nkeys = list(invalid)\npair = {keys[N % len(keys)]: invalid[keys[N % len(keys)]], keys[(N+1) % len(keys)]: invalid[keys[(N+1) % len(keys)]]}\ncheck('two independent violations in variant', solve(dict(r, **pair)), False)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":" 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"xd-failover-promote-standby_writable","generated_at":"2026-09-29T14:36:58.544502+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic local contract for reliability. Each negative fixture violates exactly one invariant. No transport timing, persistence, cryptographic verification, or full protocol implementation is claimed.","repair":"Require r['standby_writable'] is True together with every other stated precondition before accepting the operation.","root_cause":"The admission path omits the standby writable invariant while validating the other operation preconditions.","sha256":"4e28013ebcfa5a2542b1881f7373ba2effd510af314af0a37a94cdec13a20f1c","title":"Promote a standby after primary failure: A read-only standby is advertised as write primary · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":30.234,"exit_code":1,"observations":[{"actual":true,"check":"valid operation","expected":true,"passed":true},{"actual":false,"check":"Promotion permits two writable primaries","expected":false,"passed":true},{"actual":false,"check":"Standby lag exceeds the declared data-loss allowance","expected":false,"passed":true},{"actual":false,"check":"A read-only standby is advertised as write primary","expected":false,"passed":true},{"actual":true,"check":"A delayed promotion reverses a newer failover","expected":false,"passed":false},{"actual":false,"check":"Promotion succeeds while writes still route to the old primary","expected":false,"passed":true},{"actual":true,"check":"unrelated tracing metadata","expected":true,"passed":true},{"actual":true,"check":"repeat validation is pure","expected":true,"passed":true},{"actual":false,"check":"two independent violations in variant","expected":false,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"valid operation\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"Promotion permits two writable primaries\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Standby lag exceeds the declared data-loss allowance\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"A read-only standby is advertised as write primary\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"A delayed promotion reverses a newer failover\", \"actual\": true, \"expected\": false, \"passed\": false}, {\"check\": \"Promotion succeeds while writes still route to the old primary\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"unrelated tracing metadata\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"repeat validation is pure\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"two independent violations in variant\", \"actual\": false, \"expected\": false, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":33.979,"exit_code":1,"observations":[{"actual":true,"check":"valid operation","expected":true,"passed":true},{"actual":false,"check":"Promotion permits two writable primaries","expected":false,"passed":true},{"actual":false,"check":"Standby lag exceeds the declared data-loss allowance","expected":false,"passed":true},{"actual":true,"check":"A read-only standby is advertised as write primary","expected":false,"passed":false},{"actual":false,"check":"A delayed promotion reverses a newer failover","expected":false,"passed":true},{"actual":false,"check":"Promotion succeeds while writes still route to the old primary","expected":false,"passed":true},{"actual":true,"check":"unrelated tracing metadata","expected":true,"passed":true},{"actual":true,"check":"repeat validation is pure","expected":true,"passed":true},{"actual":false,"check":"two independent violations in variant","expected":false,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"valid operation\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"Promotion permits two writable primaries\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Standby lag exceeds the declared data-loss allowance\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"A read-only standby is advertised as write primary\", \"actual\": true, \"expected\": false, \"passed\": false}, {\"check\": \"A delayed promotion reverses a newer failover\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Promotion succeeds while writes still route to the old primary\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"unrelated tracing metadata\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"repeat validation is pure\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"two independent violations in variant\", \"actual\": false, \"expected\": false, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":34.413,"exit_code":0,"observations":[{"actual":true,"check":"valid operation","expected":true,"passed":true},{"actual":false,"check":"Promotion permits two writable primaries","expected":false,"passed":true},{"actual":false,"check":"Standby lag exceeds the declared data-loss allowance","expected":false,"passed":true},{"actual":false,"check":"A read-only standby is advertised as write primary","expected":false,"passed":true},{"actual":false,"check":"A delayed promotion reverses a newer failover","expected":false,"passed":true},{"actual":false,"check":"Promotion succeeds while writes still route to the old primary","expected":false,"passed":true},{"actual":true,"check":"unrelated tracing metadata","expected":true,"passed":true},{"actual":true,"check":"repeat validation is pure","expected":true,"passed":true},{"actual":false,"check":"two independent violations in variant","expected":false,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"valid operation\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"Promotion permits two writable primaries\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Standby lag exceeds the declared data-loss allowance\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"A read-only standby is advertised as write primary\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"A delayed promotion reverses a newer failover\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"Promotion succeeds while writes still route to the old primary\", \"actual\": false, \"expected\": false, \"passed\": true}, {\"check\": \"unrelated tracing metadata\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"repeat validation is pure\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"two independent violations in variant\", \"actual\": false, \"expected\": false, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}