FAILURE MAP
← Case archive

FA-126 / Storage and queries / Open access

A snapshot read selects a version committed after its cutoff · case 01

A read returns the newest physical version even though that version was not visible at the reader's snapshot.

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

ROOT CAUSE

Physical recency is used instead of the greatest commit sequence that is at or before the snapshot cutoff.

VERIFIED REPAIR

Filter versions by commit visibility, then select the greatest eligible commit sequence independently for every key.

Unsuccessful approach: Filtering out future commits but taking the first surviving row depends on arbitrary storage order and can return an older value.

Case contract

Versions are [key,commit_sequence,value], with integer commit sequences unique within a key. Return a map from key to the value at its greatest sequence <= cutoff; omit keys with no visible version. Input storage order is arbitrary.

Why this case matters

A deterministic committed-version visibility model for snapshot reads. It deliberately omits uncommitted transactions, transaction-ID wraparound, write conflict detection and real engine concurrency.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(versions, cutoff):
    chosen = {}
    for key, seq, value in versions:
        if key not in chosen or seq > chosen[key][0]:
            chosen[key] = (seq, value)
    return {key: pair[1] for key, pair in chosen.items()}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base = 10*N
check('future committed version is invisible', solve([['a', base, 'seen'], ['a', base+1, 'future']], base), {'a': 'seen'})
check('old physical row does not win', solve([['a', base-1, 'old'], ['a', base, 'new']], base), {'a': 'new'})
check('descending storage order is also valid', solve([['a', base+2, 'later'], ['a', base, N], ['a', base-2, 'old']], base), {'a': N})
check('each key has its own newest visible version', solve([['a', base, 1], ['b', base-1, 2], ['a', base+1, 3]], base), {'a': 1, 'b': 2})
check('key first created after cutoff is absent', solve([['a', base+1, N]], base), {})
check('nullable value remains a visible row', solve([['a', base, None]], base), {'a': None})
check('empty version history', solve([], base), {})
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
future committed version is invisible{'a': 'future'}{'a': 'seen'}Failed
old physical row does not win{'a': 'new'}{'a': 'new'}Passed
descending storage order is also valid{'a': 'later'}{'a': 1}Failed
each key has its own newest visible version{'a': 3, 'b': 2}{'a': 1, 'b': 2}Failed
key first created after cutoff is absent{'a': 1}{}Failed
nullable value remains a visible row{'a': None}{'a': None}Passed
empty version history{}{}Passed

SHA-256 / 7d22c530ffcd56b27510b69c142724458a3311c313374c58d547deacb761280f

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(versions, cutoff):
    chosen = {}
    for key, seq, value in versions:
        if seq <= cutoff and key not in chosen:
            chosen[key] = value
    return chosen
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base = 10*N
check('future committed version is invisible', solve([['a', base, 'seen'], ['a', base+1, 'future']], base), {'a': 'seen'})
check('old physical row does not win', solve([['a', base-1, 'old'], ['a', base, 'new']], base), {'a': 'new'})
check('descending storage order is also valid', solve([['a', base+2, 'later'], ['a', base, N], ['a', base-2, 'old']], base), {'a': N})
check('each key has its own newest visible version', solve([['a', base, 1], ['b', base-1, 2], ['a', base+1, 3]], base), {'a': 1, 'b': 2})
check('key first created after cutoff is absent', solve([['a', base+1, N]], base), {})
check('nullable value remains a visible row', solve([['a', base, None]], base), {'a': None})
check('empty version history', solve([], base), {})
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
future committed version is invisible{'a': 'seen'}{'a': 'seen'}Passed
old physical row does not win{'a': 'old'}{'a': 'new'}Failed
descending storage order is also valid{'a': 1}{'a': 1}Passed
each key has its own newest visible version{'a': 1, 'b': 2}{'a': 1, 'b': 2}Passed
key first created after cutoff is absent{}{}Passed
nullable value remains a visible row{'a': None}{'a': None}Passed
empty version history{}{}Passed

SHA-256 / e2c747574cfcebf9a86ec5fa633a11ff92443973bad0607d5f01a05207d2fe92

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(versions, cutoff):
    chosen = {}
    for key, seq, value in versions:
        if seq <= cutoff and (key not in chosen or seq > chosen[key][0]):
            chosen[key] = (seq, value)
    return {key: pair[1] for key, pair in chosen.items()}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
base = 10*N
check('future committed version is invisible', solve([['a', base, 'seen'], ['a', base+1, 'future']], base), {'a': 'seen'})
check('old physical row does not win', solve([['a', base-1, 'old'], ['a', base, 'new']], base), {'a': 'new'})
check('descending storage order is also valid', solve([['a', base+2, 'later'], ['a', base, N], ['a', base-2, 'old']], base), {'a': N})
check('each key has its own newest visible version', solve([['a', base, 1], ['b', base-1, 2], ['a', base+1, 3]], base), {'a': 1, 'b': 2})
check('key first created after cutoff is absent', solve([['a', base+1, N]], base), {})
check('nullable value remains a visible row', solve([['a', base, None]], base), {'a': None})
check('empty version history', solve([], base), {})
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
future committed version is invisible{'a': 'seen'}{'a': 'seen'}Passed
old physical row does not win{'a': 'new'}{'a': 'new'}Passed
descending storage order is also valid{'a': 1}{'a': 1}Passed
each key has its own newest visible version{'a': 1, 'b': 2}{'a': 1, 'b': 2}Passed
key first created after cutoff is absent{}{}Passed
nullable value remains a visible row{'a': None}{'a': None}Passed
empty version history{}{}Passed

SHA-256 / 388a2c3be862b3e79ee6111decb0bfc52ca3753d7a0ef8bdcfaeaea7067555bd

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

Case digest / d7e4e73dcb3d4daf06f4eda7f766283490344462d90e76e3dfb3874286810179