Fix dissemination failure despite satisfying RequiredPeerCount - #5502
Fix dissemination failure despite satisfying RequiredPeerCount#5502drupadh-dinesh wants to merge 1 commit into
Conversation
4509add to
00aef3d
Compare
Signed-off-by: Drupadh Dinesh <drupadhdinesh@gmail.com>
00aef3d to
a4673c7
Compare
|
Hi @pfi79 , |
Atishyy27
left a comment
There was a problem hiding this comment.
I traced this against SendByCriteria (gossip_impl.go L626-666) and the new single-criteria approach looks correct: MinAck acks from any of the selected peers now satisfy RequiredPeerCount, instead of each pre-designated peer having to individually ack — which was exactly the failure mode in the title. The Phase-2 partial Fisher-Yates is correctly bounded by min(len(remainingPeersAcrossOrgs), maximumPeerRemainingCount), and the in-place removal in Phase 1 is safe since ByOrg() allocates fresh slices per call. Nice catch checking the crand.Read error too.
Two observations, neither blocking:
- Collections configured with
MaximumPeerCount == 0previously produced no plan entries; they now produce one withMaxPeers: 0. It's benign (SendByCriteriano-ops onMaxPeers == 0, L627), but skipping plan construction in that case would avoid a pointless goroutine per collection indisseminate(). - Worth calling out in the description: when fewer peers are selectable than
RequiredPeerCount,MinAck > MaxPeersnow fails fast at L650 ("requested to send to at least X peers…"), where the old code silently required fewer acks than configured. I think failing loudly is the right call, but it changes outcomes in degraded-membership scenarios.
@Atishyy27, thanks for the review. Regarding the second point, this behavior already exists in the current implementation. When the number of eligible peers is less than RequiredPeerCount, dissemination already fails because of the check below: |
Type of change
Description
Previously, private data dissemination created multiple dissemination plans and assigned acknowledgement requirements (MinAck) to specific peers. As a result, dissemination could fail when an acknowledgement was not received from one of the designated peers, even if acknowledgements from other selected peers satisfied the collection's RequiredPeerCount.
This change updates dissemination planning to:
Additional details
Implementation changes include: