Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

. #2090

Merged
merged 1 commit into from
Jan 24, 2024
Merged

. #2090

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Proto.Cluster/Gossip/GossipActor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<GossipResponse>(pid, gossipRequest,
Expand Down
2 changes: 0 additions & 2 deletions src/Proto.Cluster/Gossip/IGossip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ internal interface IGossipCore
/// </summary>
/// <param name="sendStateToMember"></param>
void SendState(SendStateAction sendStateToMember);

MemberStateDelta GetMemberStateDelta(string targetMemberId);
}

internal interface IGossipConsensusChecker
Expand Down
3 changes: 2 additions & 1 deletion src/Proto.Cluster/GossipContracts.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading