Skip to content

Commit 3aaf281

Browse files
authored
docs: clarify gossip membership flow (#2374)
1 parent 3673d78 commit 3aaf281

File tree

2 files changed

+56
-6
lines changed

2 files changed

+56
-6
lines changed

CLUSTER_MEMBERSHIP_GOSSIP.md

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ flowchart LR
3333
`GossipRequest`; the default `GossipTransport` simply forwards the request
3434
through `IContext.RequestReenter`.
3535

36-
### Type relationships
36+
### Component relationships
3737

3838
```mermaid
3939
classDiagram
@@ -49,18 +49,62 @@ classDiagram
4949
class GossipTransport
5050
Gossiper o-- Gossip
5151
Gossiper --> GossipActor : commands
52-
Gossiper --> GossipSender : uses
5352
GossipActor --> Gossip : merges
54-
Gossip --> GossipState : holds
55-
Gossip --> MemberStateDeltaBuilder : uses
56-
GossipSender ..> GossipRequest : sends
57-
GossipSender ..> GossipResponse : receives
53+
GossipActor --> MemberStateDeltaBuilder : builds deltas
54+
GossipActor --> GossipSender : uses
5855
GossipSender ..> IGossipTransport
5956
IGossipTransport <|-- GossipTransport
57+
GossipSender ..> GossipRequest : sends
58+
GossipActor --> GossipRequest : handles
59+
GossipActor --> GossipResponse : replies
6060
```
6161

6262
`Gossip` maintains a `GossipState` and exchanges `GossipRequest` and `GossipResponse` messages via `IGossipTransport` to synchronize that state across nodes.
6363

64+
### Gossip message flow
65+
66+
#### Sending a delta
67+
68+
```mermaid
69+
sequenceDiagram
70+
participant Gossiper
71+
participant GossipActor
72+
participant DeltaBuilder
73+
participant GossipSender
74+
participant Transport
75+
participant RemoteActor
76+
77+
Gossiper->>GossipActor: SendGossipStateRequest
78+
GossipActor->>DeltaBuilder: build per-target delta
79+
DeltaBuilder-->>GossipActor: MemberStateDelta
80+
GossipActor->>GossipSender: target, delta, request
81+
GossipSender->>Transport: Request(pid, GossipRequest)
82+
Transport->>RemoteActor: GossipRequest
83+
RemoteActor-->>Transport: GossipResponse
84+
Transport-->>GossipSender: callback
85+
GossipSender-->>DeltaBuilder: CommitOffsets
86+
```
87+
88+
`Gossiper` periodically instructs the `GossipActor` to send state by issuing a `SendGossipStateRequest`【F:src/Proto.Cluster/Gossip/Gossiper.cs†L452-L466】. The actor builds a `GossipRequest` for each target and uses `GossipSender` to transmit it through the configured `IGossipTransport`【F:src/Proto.Cluster/Gossip/GossipActor.cs†L199-L218】【F:src/Proto.Cluster/Gossip/GossipSender.cs†L21-L57】.
89+
90+
#### Receiving a request
91+
92+
```mermaid
93+
sequenceDiagram
94+
participant Transport
95+
participant GossipActor
96+
participant Gossip
97+
participant EventStream
98+
99+
Transport->>GossipActor: GossipRequest
100+
GossipActor->>Gossip: ReceiveState
101+
Gossip-->>GossipActor: updates
102+
GossipActor->>EventStream: publish updates
103+
GossipActor-->>Transport: GossipResponse
104+
```
105+
106+
Incoming `GossipRequest` messages are handled by the `GossipActor`, which merges the state and publishes any resulting updates to the event stream before replying with `GossipResponse`【F:src/Proto.Cluster/Gossip/GossipActor.cs†L124-L161】.
107+
64108
## Detecting members
65109

66110
Cluster providers (e.g., Kubernetes) watch the environment for running nodes and

logs/log1756024459.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Documentation cleanup
2+
3+
- clarified component roles in gossip membership doc
4+
- added sequence diagrams for send and receive flows
5+
- verified links with source code
6+
- installed .NET SDK 8 and ran core test suites

0 commit comments

Comments
 (0)