concurrent_append_SUITE: twenty writers held to the concurrency contract; the race waits on progress (#7) #8

Manually merged
terra merged 0 commits from neptunus/7-concurrent-append-timeout into main 2026-12-02 09:20:32 +00:00
Member

Refs #7.

The 20-writer case timed out on the forge in 4 of 5 full-gate runs. Supervisor's ruling (2026-12-02, relayed by Mars): option (2), the 20-writer case asserts the real optimistic-concurrency contract on slow storage.

Cause. The forge runner is about 25 times slower than a laptop (20 writers x 100 appends took 42223 ms there, against 1.7 s locally). At that speed a few appends lose all 60 retry attempts and are refused as version_conflict (2 of 2000). The old fixed 30 s wait hid that refusal behind a timeout. No writer stalled. Tuning the retry pause does not fix it (see #7): that idea was tried and dropped. Per-stream serialization is filed as #9, not built.

Changes (test plus one header comment):

  1. The writer race waits on progress, not on a fixed 30 s. It fails only when no writer finishes an append for 30 s, and then names each unfinished writer's count and stack. Every race logs its duration.
  2. twenty_writers_on_one_stream_keep_every_event becomes twenty_writers_on_one_stream_store_exactly_what_was_acknowledged:
    • every answer is {ok, _} or {error, {version_conflict, -2, _}};
    • the stored versions are exactly the acknowledged ones, with no gap;
    • every event carries a unique id, so a duplicate shows.
  3. ten_writers_on_one_stream_keep_every_event still requires every append to land. It passed in every forge run, so no backoff change is needed for it.
  4. reckon_db.hrl: the 20-writer figures are fast storage, and slow storage reaches the cap (#7, #9).

Proof.

  • Locally: 10/10.
  • A stand-in for the slow runner (the pinned CI image at --cpus 0.1): the contract case passes, with 1964 of 2000 acknowledged and 36 refused, all accounted for.
  • Mutants on reckon_db_streams, each turning the contract case red:
    • the version guard always passes (overwrite): killed;
    • every acknowledged append written twice (duplicate): killed;
    • a capped refusal answered as ok (false acknowledgement): killed on the stand-in. At full local speed no append reaches the cap, so that path only runs on slow storage.
Refs #7. The 20-writer case timed out on the forge in 4 of 5 full-gate runs. Supervisor's ruling (2026-12-02, relayed by Mars): option (2), the 20-writer case asserts the real optimistic-concurrency contract on slow storage. **Cause.** The forge runner is about 25 times slower than a laptop (20 writers x 100 appends took 42223 ms there, against 1.7 s locally). At that speed a few appends lose all 60 retry attempts and are refused as `version_conflict` (2 of 2000). The old fixed 30 s wait hid that refusal behind a timeout. No writer stalled. Tuning the retry pause does not fix it (see #7): that idea was tried and dropped. Per-stream serialization is filed as #9, not built. **Changes (test plus one header comment):** 1. The writer race waits on progress, not on a fixed 30 s. It fails only when no writer finishes an append for 30 s, and then names each unfinished writer's count and stack. Every race logs its duration. 2. `twenty_writers_on_one_stream_keep_every_event` becomes `twenty_writers_on_one_stream_store_exactly_what_was_acknowledged`: - every answer is `{ok, _}` or `{error, {version_conflict, -2, _}}`; - the stored versions are exactly the acknowledged ones, with no gap; - every event carries a unique id, so a duplicate shows. 3. `ten_writers_on_one_stream_keep_every_event` still requires every append to land. It passed in every forge run, so no backoff change is needed for it. 4. `reckon_db.hrl`: the 20-writer figures are fast storage, and slow storage reaches the cap (#7, #9). **Proof.** - Locally: 10/10. - A stand-in for the slow runner (the pinned CI image at `--cpus 0.1`): the contract case passes, with 1964 of 2000 acknowledged and 36 refused, all accounted for. - Mutants on reckon_db_streams, each turning the contract case red: - the version guard always passes (overwrite): killed; - every acknowledged append written twice (duplicate): killed; - a capped refusal answered as ok (false acknowledgement): killed on the stand-in. At full local speed no append reaches the cap, so that path only runs on slow storage.
concurrent_append_SUITE: the writer race waits on progress, not on a fixed 30 s (reckon-db#7)
Some checks failed
lint-and-test / rust (clippy, deny warnings) (pull_request) Successful in 35s
lint-and-test / rust (clippy, deny warnings) (push) Successful in 34s
lint-and-test / compile + NIFs + xref + lint + eunit + ct + proper + dialyzer (OTP 28.4.3) (pull_request) Successful in 8m21s
lint-and-test / compile + NIFs + xref + lint + eunit + ct + proper + dialyzer (OTP 28.4.3) (push) Failing after 9m2s
77570b6dc5
reckon_db.hrl: the 20-writer figures are fast storage; slow storage reaches the cap (reckon-db#7)
Some checks failed
lint-and-test / rust (clippy, deny warnings) (push) Successful in 31s
lint-and-test / rust (clippy, deny warnings) (pull_request) Successful in 30s
lint-and-test / compile + NIFs + xref + lint + eunit + ct + proper + dialyzer (OTP 28.4.3) (pull_request) Successful in 9m45s
lint-and-test / compile + NIFs + xref + lint + eunit + ct + proper + dialyzer (OTP 28.4.3) (push) Failing after 9m45s
6977e74cb6
neptunus changed title from concurrent_append_SUITE: the writer race waits on progress and names a stall (#7) to concurrent_append_SUITE: twenty writers held to the concurrency contract; the race waits on progress (#7) 2026-12-02 08:17:40 +00:00
concurrent_append_SUITE: ten writers are held to the contract too (reckon-db#7)
All checks were successful
lint-and-test / rust (clippy, deny warnings) (push) Successful in 28s
lint-and-test / rust (clippy, deny warnings) (pull_request) Successful in 40s
lint-and-test / compile + NIFs + xref + lint + eunit + ct + proper + dialyzer (OTP 28.4.3) (push) Successful in 8m52s
lint-and-test / compile + NIFs + xref + lint + eunit + ct + proper + dialyzer (OTP 28.4.3) (pull_request) Successful in 9m4s
52ed296423
The ten- and twenty-writer cases reach the retry cap only on slow storage,
so at normal speed nothing checked what a capped append answers or writes.
A TEST-only export of try_append/6 lets the suite drive the last attempt
with a version one behind the stream: it must answer
{error, {version_conflict, ANY_VERSION, Read}} and leave the stream as it was.
Merge remote-tracking branch 'origin/main' into neptunus/7-concurrent-append-timeout
All checks were successful
lint-and-test / rust (clippy, deny warnings) (pull_request) Successful in 34s
lint-and-test / compile + NIFs + xref + lint + eunit + ct + proper + dialyzer (OTP 28.4.3) (pull_request) Successful in 9m51s
lint-and-test / rust (clippy, deny warnings) (push) Successful in 36s
lint-and-test / compile + NIFs + xref + lint + eunit + ct + proper + dialyzer (OTP 28.4.3) (push) Successful in 10m3s
25726f2b8c
terra manually merged commit 25726f2b8c into main 2026-12-02 09:20:32 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
reckon-db-org/reckon-db!8
No description provided.