Function append_reports_exceeded_store_limits
pub async fn append_reports_exceeded_store_limits<F: Fixture>(
open: impl AsyncFn() -> F,
) -> RuleOutcomeExpand description
A store that refuses an over-capacity append reports it as
AppendError::ExceedsStoreLimit, and never by truncating.
VT-25 [FROZEN], and the refusal half of the four floors this section’s
other rules cover. VT-21 – VT-24 say what every store MUST accept; this
says what a store MUST do about anything larger. The distinction the
variant exists for is a sync runner’s: “this event will never fit here,
park it and tell a human” against “the disk is full, retry”. A runner that
cannot tell them apart guesses, and a runner that guesses wrong drops an
event permanently (E2E-42).
§Why the ceilings come from the fixture (CF-40)
There is no MAX_EVENT_DATA_LEN constant and there must not be one — a
single number is a straitjacket on Postgres and a lie on a KV-backed peer.
So the ceiling is a fact about this store, and the fixture states it:
MAX_EVENT_DATA_LEN,
MAX_TAGS_PER_EVENT,
MAX_EVENTS_PER_BATCH,
MAX_METADATA_LEN and
MAX_TAGS_PER_BATCH, each
defaulting to None.
They are Option<usize> and not Capability,
and the difference is not cosmetic. A declined Capability is a trade:
the fixture could have co-operated and chose not to, and the reason it
gives is the record of that choice. None here is a store reporting a
fact about itself — that it has no ceiling — and there is nothing to trade
away. It routes through the same skipped-with-a-reason path because the
reporting obligation is identical: a rule that cannot run must say so, or
a green suite is indistinguishable from a green suite minus one rule.
§What it rejects
Four compiled stores, in two pairs, and each pair is one column with the
engine configured two ways. PayloadCeilingStore and
BatchParameterCeilingStore refuse through AppendError::Store — which
is what every adapter does today, because until this variant existed there
was nowhere else to put it. TruncatingPayloadStore and
ChunkLosingBatchStore do not refuse at all: they store what fits, answer
Ok with a real position, and the caller is told the whole write landed.
The second pair is why each limit is checked twice — once for the answer,
once for what is in the store afterwards.
The metadata branch (ADR-0043) has five of its own, one per assertion:
MetadataCeilingStore refuses through AppendError::Store,
MisnamedMetadataCeilingStore names EventDataLen,
TruncatingMetadataStore clips and answers Ok,
OffByOneMetadataCeilingStore refuses the ceiling itself, and
RefuseAfterInsertMetadataStore refuses after writing the event.
The tags-per-batch branch (VT-36, ADR-0100) has seven, and a control,
TagsPerBatchCeilingStore. TagsPerBatchThroughStoreStore refuses
through AppendError::Store, MisnamedTagsPerBatchStore names
TagsPerEvent, PerEventTagsPerBatchStore compares each event with the
batch ceiling and so lands the over batch, OffByOneTagsPerBatchStore
refuses the ceiling itself, and RefuseAfterInsertTagsPerBatchStore
refuses after writing. The last two enforce what they state and state
something incoherent: UnreachableTagsPerBatchStore a total no batch can
reach under its other two ceilings, and
TagsPerBatchBelowTagsPerEventStore a total below its per-event ceiling,
under which a split batch never stops needing to be split. Those two
fail before any branch writes, because the declaration is what is wrong.
§The at-the-ceiling append is the anchor
Without it a store that refused everything would satisfy every assertion
below, and the rule would certify a ceiling nobody had located. A value at
exactly the stated limit must be accepted; a value one larger must be
refused. Nothing here asserts what the limit is — that is the store’s to
document — only that it is where the fixture says it is. Nor does anything
assert the len field’s value: VT-25 says it carries “the value that
exceeded” the limit, and an adapter that reports its own ceiling instead
is answering a caller’s question about magnitude either way.