Skip to content

v0.3.7

@losfair losfair tagged this 05 Apr 09:13
The previous commit used thread-local storage to pass the commit group
result to participating connections. This is incorrect because
connections may migrate between threads when no commit group is active.

Replace the thread-local with an Arc<OnceLock<CommitGroupResultData>>
shared slot owned by the CommitGroup. Each connection receives its own
Arc clone from append_intent() and stores it as a field. commit()
writes the result into the shared slot. On the next lock() call, the
connection reads its slot, applies the changelog, advances
last_known_write_version, and drops the Arc.

Use .as_ref() rather than .take() when probing the slot so that it
survives unpopulated reads — if lock() fires between finalize and
mv_commit_group_commit, the slot must remain for later consumption.

Also adds unit tests for CommitGroupResultSlot and bumps version
to 0.3.7.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assets 2
Loading