-
Notifications
You must be signed in to change notification settings - Fork 912
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
ARTEMIS-4305 Zero persistence does not work in kubernetes #4899
base: main
Are you sure you want to change the base?
Conversation
94ac5ea
to
7f8833c
Compare
I think you could simplify this quite a bit. Here's what I suggest...
You also needs tests to verify the fix and mitigate regressions in the future. |
Initially I attempted what you suggest about lazy initializing the node id like that, precicely because I wanted to keep the code changes to a minimum. However, that ended up being much more complicated(rather than simplified), because of the way IMO from a functional standpoint, adding the
|
…rams` map to acceptors and connectors
* include original node id in `TransportConfiguration` decoding * match ping packets' nodeUUID against the connection's transport configuration target nodeUUID; if any side is missing this data, the match succeeds * destroy a remoting connection if it ever becomes unhealthy(ping nodeUUID is different that the target)
7f8833c
to
5eabef6
Compare
@@ -408,10 +416,15 @@ public void endOfBatch(Object connectionID) { | |||
} | |||
|
|||
private void doBufferReceived(final Packet packet) { | |||
if (isHealthy && !isCorrectPing(packet)) { | |||
isHealthy = false; |
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.
Commenting this line out will effectively disable the fix. This will cause the new test ZeroPersistenceSymmetricalClusterTest
to fail.
If this is an issue in Core, it will be an issue in AMQP as well. we should make sure AMQP also takes care of this? WDYT @jbertram @gemmellr @gtully @tabish121 ? |
I believe the use-case here only involves cluster nodes and the core connections between them. Therefore, I don't think AMQP is in view. |
In a cluster deployed in kubernetes, when a node is destroyed it terminates the process and shuts down the network before the process has a chance to close connections. Then a new node might be brought up, reusing the old node’s ip. If this happens before the connection ttl, from artemis’ point of view, it looks like as if the connection came back. Yet it is actually not the same, the peer has a new node id, etc. This messes things up with the cluster, the old message flow record is invalid.
This also solves another similar issue - if a node goes down and a new one comes in with a new nodeUUID and the same IP before the cluster connections in the others timeout, it would cause them to get stuck and list both the old and the new nodes in their topologies.
The changes are grouped in tightly related incremental commits to make it easier to understand what is changed:
Ping
packets includenodeUUID
TransportConfiguration
RemotingConnectionImpl#doBufferReceived
tracks for ping nodeUUID mismatch with the target to flag it asunhealthy
;ClientSessionFactoryImpl
destroys unhealthy connections(in addition to not receiving any data on time)