mirror of
https://github.com/element-hq/synapse.git
synced 2026-11-04 17:47:28 +00:00
A write transaction that failed after prefetching cache stream IDs finished all of them, but left the unused ones spare. The retry handed those out first, so it wrote cache invalidations at IDs below the stream's position, which other workers never fetch. Finishing the pending IDs now drops the spare ones too. The prefetch also began its fetch only once the `nextval` rows were back, so the position could pass an ID still on its way. It now begins before the reads are sent, as `next_ids` does, and ends unallocated if they fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PVLsNh6akt4ifEizY4D1ta