Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current issue is that there are no events dispatched for
NEW_NODE
changes. In a 3 node cassandra cluster deployed on cloud infrastructure, a cassandra instance was replaced using thereplace_address
flag so that it was moved to a new cloud instance (new IP, new host ID). The following debug logs are an example of how the client is currently handling this change in topology.There is no event dispatched for the
NEW_NODE
event and it jumps straight to processing theUP
event, so the new node is never added to session ring. If all nodes in the cluster are replaced in this manner, the eventual outcome is that clients lose connection to the cluster and begin outputtinggocql: no hosts available in the pool
.After bisecting recent commits, I found this PR introduced the bug into the client. It looks like there was seemingly a fail-safe for when the
NEW_NODE
event was missed, but this function was removed in the previously mentioned PR.This change proposes to refresh the hostSource ring on
UP
events when the host cannot be found in the ring. This ensures that the hostMap stays up to date even ifNEW_NODE
events are not processed.This should fix apache#1668, apache#1667, and apache#1582