diff options
| author | eunhhu <[email protected]> | 2026-09-26 06:30:03 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-26 06:30:03 +0100 |
| commit | 9408c57e0f2485fd7960135c931aa120dcb3fa8f (patch) | |
| tree | a88f51124bb3d539752a87be0656a0546505682d /prototypes/connections/state.h | |
| parent | c7ae77cdf4623c3eb07935081510478be9063024 (diff) | |
| download | pure-9408c57e0f2485fd7960135c931aa120dcb3fa8f.tar.gz pure-9408c57e0f2485fd7960135c931aa120dcb3fa8f.zip | |
Group the commits of concurrent threads
Threads that commit at the same time now share one commit: they queue,
the first becomes the leader and publishes every queued request of the
same store with one head, and the others wait for its result. Each
request stays all or nothing on its own: one with a stale draft is left
out, and so is one whose key an earlier request of the group changes.
When several threads have been committing together, a leader waits up to
2 ms for as many to join as groups held lately; a single thread never
waits.
A test pauses a publication and checks that five commits make exactly two
publications. Under eight writers on three pure-serve shards, 1,234
bursts went out in 421 publications. pure_store_group_counts reports the
groups, and pure-serve prints them.
Diffstat (limited to 'prototypes/connections/state.h')
| -rw-r--r-- | prototypes/connections/state.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/prototypes/connections/state.h b/prototypes/connections/state.h index 60d333c..55474c0 100644 --- a/prototypes/connections/state.h +++ b/prototypes/connections/state.h @@ -61,5 +61,7 @@ PureResult pure_draft_commit(PureDraft *, int64_t *revision); * draft's base revision (a conflict names the stored revision in revisions), * and either every draft is published or none is. Keys must differ. */ PureResult pure_draft_commit_all(PureDraft *const *drafts, size_t count, int64_t *revisions); +/* Commits made so far in this process: groups formed, and requests in them. */ +void pure_store_group_counts(unsigned long *groups, unsigned long *requests); void pure_draft_close(PureDraft *); #endif |
