-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Cluster] Enable HeartbeatResponse message type #6063
[Cluster] Enable HeartbeatResponse message type #6063
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to change our defaults, but otherwise LGTM
Done, changed the setting to opt-out, not opt-in |
…us/akka.net into CLUSTER_Enable_HeartbeatResponse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can skip the serializer changes and just modify
private T AssertAndReturn<T>(T message)
{
var serializer = Sys.Serialization.FindSerializerFor(message);
var serialized = serializer.ToBinary(message);
serializer.Should().BeOfType<ClusterMessageSerializer>();
return serializer.FromBinary<T>(serialized);
}
to cast the returned serializer into SerializerWithStringManifest
and then manually call .Manifest
on that. If the serialization binding is wrong then the cast will fail.
src/core/Akka.Cluster/Serialization/ClusterMessageSerializer.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to harden tests
@@ -63,20 +67,6 @@ public void Can_serialize_HeartbeatRsp() | |||
AssertEqual(message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test only succeeds because -1,
, -1
are the hard-coded values when legacy==on. Need to harden this to make sure that the correct, non--1
values are supported when legacy==off
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AssertEqual
regardless of config is what's not going to work here. Change
var message = new ClusterHeartbeatSender.HeartbeatRsp(uniqueAddress, -1, -1);
to
var message = new ClusterHeartbeatSender.HeartbeatRsp(uniqueAddress, 10, 3);
When legacy off, 10,3
When legacy on, -1, -1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
…egacy code still have the old behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - nice work @Arkatufus
TODO: need to add an issue for this letting users know about this setting as part of the Akka.NET 1.5 upgrade advisories |
Fixes #6061
Changes
HeartbeatResponse
andHeartbeat
protobuf wire format for cluster hearbeats.akka.cluster.use-legacy-heartbeat-message
HOCON settings, defaults to false. When set to true, the serializer will use the old legacyHeartbeat
messages.HeartbeatResponse
andHeartbeat
proto serializer