docs(adr): ADR-174 Amendment 7, the batch admits a bounded list - #2544
Merged
Conversation
stream.batch refuses an empty ops list and names the writer it would take for a batch that writes nothing. It does not refuse a large one, and in atomic mode the whole list executes inside one BEGIN IMMEDIATE, so the statement count inside a single writer hold is whatever the caller sent. The only ceiling today is the 8 MiB frame, a transport limit, which for a minimal member admits a count on the order of a hundred thousand. The amendment fixes the numbers: at most 1000 members and at most 100 observations, refused with invalid_input naming both the cap and the count sent, checked at admission before any member is parsed, any plan prepared or any writer requested. The bound is on the list the caller sends, so it holds in both modes. Per-member mode is already bounded by construction, and is capped anyway so that one input is refused the same way whatever the mode. This is not the per-namespace quota section 6 puts out of scope, and the record size limit is still the note's. Seven acceptance arms, including the at-the-cap arm that keeps the bound from drifting below its number, the unchanged stream head as the control that the refusal preceded the writer, and two mutations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
stream.batchrefuses an emptyopslist, and says why: an empty list takes the writer for a batch that writes nothing. It does not refuse a large one.In atomic mode the whole list executes inside one
BEGIN IMMEDIATE. Each observation is a pairedSELECT id, version, each append member is a prepared note plan plus a ledgerINSERT, each write member a prepared plan plus aSELECT version, updated_at. So the statement count inside a single writer hold is whatever the caller sent, and the only ceiling is the daemon's 8 MiB frame — a transport limit, which for a minimal append member admits a member count on the order of a hundred thousand. SQLite admits one writer, so one such call extends every competing writer's wait.Every comparable admission in the store names its own number: web manifest ingest at 10,000 entities and 50,000 edges, blob GC at 128 rows per unit. This amendment names this verb's.
What it fixes
ops, at most 100 entries inobserved.invalid_input, naming both the cap and the count sent, so a caller learns how far over it is without bisecting.observedrequires atomic mode, so its cap has one mode by construction.This is not the per-namespace or per-stream quota §6 puts out of scope: it is an admission bound on one request's list, and the record size limit is still the note's.
Acceptance is seven arms: at the cap (which keeps the bound from drifting below its stated number), over the cap with the stream head unchanged as the control that the refusal preceded the writer, the observation cap told apart from the member cap, per-member mode refusing the same input the same way, a list of individually-invalid members proving the cap is checked before members are interpreted, help, and two mutations.
Docs only. The implementing change publishes the measured writer hold time at the cap beside the hold at the largest member count the frame admits.
Recorded as unresolved in ADR-091 Amendment 18 (#2445) and filed as #2543.