Repository navigation
Conversation
…] zip
topo-east-1 spammed
``RaftDispatcher: no pusher for topo-east-{2,3}, dropping
cluster/raft/pre-request-vote-reply reply`` several times a second
while the symmetric west cluster was quiet. The asymmetry traced to
a positional ``zip`` in ``build_peer_pushers`` that pairs
``opts["cluster_peers"]`` with the deduplicated ``self.pushers``
list. Two drift modes silently truncated the pusher table and left
the tail peer unkeyed:
1. ``MasterPubServerChannel.handle_pool_publish`` appends to
``self.cluster_peers`` (a reference to ``opts["cluster_peers"]``)
on every ``cluster/peer/join`` and ``cluster/peer/discover-reply``
from a peer. A join from a statically-configured peer grew the
list with a duplicate while ``_add_pusher``'s
``(pull_host, pull_port)`` dedup kept ``self.pushers`` the same
length. ``zip`` then stopped one short and the last declared
peer received no pusher — inbound Raft replies from it hit "no
pusher" and were dropped. On the designated founder (east-1 has
lowest id in its cluster), the 5-second ``cluster_join_timeout``
deferral leaves a wide window for this race before
``_start_raft_as_founding_voter`` runs ``build_peer_pushers``;
west's founder won the race in the sandbox probe where east lost.
2. A ``cluster_peers`` entry carrying an explicit ``host:port``
suffix (the ``peer.rsplit(":", 1)`` branch) was keyed as
``"host:port"`` in the pusher dict while the dispatcher looks the
pusher up by the sender's ``callback_node`` = its bare node-id =
``"host"``. Lookup always missed.
Fix mirrors the already-robust ``_start_raft_as_learner`` keying:
build the pusher dict as ``{p.pull_host: p for p in pushers}``.
``opts`` stays in the signature for callers; the opts list is no
longer the source of truth for the dict shape. Companion changes
in ``MasterPubServerChannel.handle_pool_publish`` gate both
``cluster_peers.append`` sites with a membership check so the
underlying ``opts["cluster_peers"]`` list stops accumulating
duplicates in the first place.
Red-then-green on the two new regression tests in
``tests/pytests/functional/cluster/consensus/test_raft_service.py``
(``test_cluster_peers_duplicate_does_not_lose_pusher`` +
``test_cluster_peers_host_port_form_still_keys_by_host``) via
``git stash`` of the production diff; both fail without the fix and
pass with it. Full consensus functional suite: 123 passed.
``tests/pytests/unit/channel/test_server.py``: 61 passed.
``FakePusher`` gains a ``pull_host`` attribute so the in-process
test harness mirrors the real ``PublishServer`` surface the
post-fix ``build_peer_pushers`` keys by.
3 tasks done
Contributor
Author
|
Superseded by #70755 which combines all five cluster-correctness backports into a single PR. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport from master-topology work.
build_peer_pushersusedzip(opts["cluster_peers"], pushers_list)to build the Raft dispatcher's pusher table. Two drift conditions silently broke inbound Raft RPCs:self.cluster_peerswithout a dedup check, whileself.pusherswas deduped by_add_pusher. Azipthen truncated to the shorter pushers list, leaving the tail peer unkeyed. Inbound Raft RPCs from that peer loggedno pusher for <peer_id>, dropping <tag> replyand pre-vote / append-entries replies were lost.cluster_peersentries can carry an explicithost:portsuffix (thepeer.rsplit(":", 1)branch in_publish_daemon), while the pusher'spull_hostis the bare host. Azipkeyed the pusher dict by"host:port"while the dispatcher looked up"host"— never matched.Fix: key the pusher table by each pusher's own
pull_hostattribute. Matches the pattern_start_raft_as_learneralready uses.Test plan
pytest tests/pytests/unit/cluster/consensus/ tests/pytests/functional/cluster/consensus/— 511 passed