diff --git a/src/Proto.Cluster/Gossip/GossipActor.cs b/src/Proto.Cluster/Gossip/GossipActor.cs index 1514e4f414..ceda156ef3 100644 --- a/src/Proto.Cluster/Gossip/GossipActor.cs +++ b/src/Proto.Cluster/Gossip/GossipActor.cs @@ -170,7 +170,9 @@ private Task OnSetGossipStateKey(IContext context, SetGossipStateKey setStateKey private Task OnSendGossipState(IContext context) { - _internal.SendState((memberState, member, logger) => SendGossipForMember(context, member, memberState)); + void SendStateToMember(MemberStateDelta memberState, Member member, InstanceLogger? logger) => SendGossipForMember(context, member, memberState); + + _internal.SendState(SendStateToMember); context.Respond(new SendGossipStateResponse()); return Task.CompletedTask; @@ -190,10 +192,11 @@ private void SendGossipForMember(IContext context, Member targetMember, var gossipRequest = new GossipRequest { MemberId = context.System.Id, - State = memberStateDelta.State.Clone() //ensure we have a copy and not send state that might mutate + State = memberStateDelta.State.Clone(), //ensure we have a copy and not send state that might mutate }; if (context.Cluster().Config.GossipDebugLogging) { + gossipRequest.RequestId = Guid.NewGuid().ToString("N"); Logger.LogInformation("Sending GossipRequest {Request} to {MemberId}", gossipRequest, targetMember.Id); } context.RequestReenter(pid, gossipRequest, diff --git a/src/Proto.Cluster/Gossip/IGossip.cs b/src/Proto.Cluster/Gossip/IGossip.cs index 7b1346ede5..85c61a8b40 100644 --- a/src/Proto.Cluster/Gossip/IGossip.cs +++ b/src/Proto.Cluster/Gossip/IGossip.cs @@ -39,8 +39,6 @@ internal interface IGossipCore /// /// void SendState(SendStateAction sendStateToMember); - - MemberStateDelta GetMemberStateDelta(string targetMemberId); } internal interface IGossipConsensusChecker diff --git a/src/Proto.Cluster/GossipContracts.proto b/src/Proto.Cluster/GossipContracts.proto index 432c7a7aae..ca51b47135 100644 --- a/src/Proto.Cluster/GossipContracts.proto +++ b/src/Proto.Cluster/GossipContracts.proto @@ -5,8 +5,9 @@ import "google/protobuf/any.proto"; message GossipRequest { - string member_id = 2; GossipState state = 1; + string member_id = 2; + optional string request_id = 3; } //Ack a gossip request