Rust: batch writes merge onto the store (rs-batch-merges-onto-store) #135

Merged
libby merged 3 commits from libby/rs-batch-merges-onto-store into main 2026-11-12 08:45:53 +00:00
Member

Closes follow-up cultlib-gaps:follow_up:rs-batch-merges-onto-store.

CacheBackingStore::push_all is now an atomic write of the given entries onto the store as it is at commit time (single-file under the exclusive lock, both redb stores in one transaction); nothing else is removed. put_prepared_batch hands the store its staged records alone, which deletes the snapshot and foreign-record lay-back code. A cache whose image is stale (second writer added a key after its pull) no longer wipes that key: pinned in single-file and redb, failing before the change.

Consequences, in the changelog: a custom store must merge in push_all; push_all through a dangling link is refused like push (it used to replace the link; test and README line updated); soft flush unchanged. The single-file commit guard now judges the merged store, so a stale cache that retypes a key another writer added is refused there.

Parity: C# CommitBatch and Python push_all already merge; TS pushAll still replaces (ts-flush-replaces-store, next).

🤖 Generated with Claude Code

Closes follow-up `cultlib-gaps:follow_up:rs-batch-merges-onto-store`. `CacheBackingStore::push_all` is now an atomic write of the given entries onto the store as it is at commit time (single-file under the exclusive lock, both redb stores in one transaction); nothing else is removed. `put_prepared_batch` hands the store its staged records alone, which deletes the snapshot and foreign-record lay-back code. A cache whose image is stale (second writer added a key after its pull) no longer wipes that key: pinned in single-file and redb, failing before the change. Consequences, in the changelog: a custom store must merge in `push_all`; `push_all` through a dangling link is refused like `push` (it used to replace the link; test and README line updated); soft flush unchanged. The single-file commit guard now judges the merged store, so a stale cache that retypes a key another writer added is refused there. Parity: C# CommitBatch and Python push_all already merge; TS pushAll still replaces (`ts-flush-replaces-store`, next). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Rust: batch writes merge onto the store (rs-batch-merges-onto-store)
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
dc3fca627b
push_all applies the given entries onto the store as it is under its lock or transaction instead of replacing it, so a cache with a stale image cannot drop a record another writer added. put_prepared_batch sends only its staged records.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Rust: batch merge retains by (type, key), repeated staged keys land last, dead dangling-link branch removed
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
5b50dd9b06
Soul findings on #135: the single-file merge matched on schema id where push matches on type, so a record under another schema id was refused as a retype; redb refused a batch repeating a key; the owned redb merge and a stale revert were unpinned; write_all_unlocked kept a dangling-link branch no caller can reach.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Rust: pin push_all replacing a record held under another schema id
All checks were successful
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Successful in 20m14s
3255169abb
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
libby merged commit fbeb773d35 into main 2026-11-12 08:45:53 +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
GameCult/CultLib!135
No description provided.