Breaking change: reconnect_to_initial_nodes will be called only when AllConnectionsUnavailable #183
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.
Breaking changes: The
ClusterConnectionNotFound
error has been renamed toAllConnectionsUnavailable
, and a new error,ConnectionNotFoundForRoute
, has been introduced to handle cases where a specific connection cannot be found. Previously,ClusterConnectionNotFound
was incorrectly used for missing specific connections, which triggeredreconnect_to_initial_nodes
. However,reconnect_to_initial_nodes
should only be invoked when all connections are unavailable, as its purpose is to gather more information from the seed nodes. With this update, whenConnectionNotFoundForRoute
is encountered, the system will callrefresh_slots
and retry the request according to the configured retry logic.Although
reconnect_to_initial_nodes
is now intended to be called only when no available connections are found, there might still be scenarios where it is triggered even though the connection map isn't empty, due to ongoing tasks refreshing connections. Currently, whenreconnect_to_initial_nodes
is called, we create a connection map that includes only the seed nodes provided by the user, replacing the existing connection map. This approach introduces a period where the connection map contains only a subset of the cluster nodes (e.g., the seed nodes), and the slots haven't been refreshed yet. During this time, new requests may come in and find connections only to the seed nodes. If the seed nodes are no longer valid, the client will be unable to send requests to random nodes or rely on MOVED responses. This PR updates the function to extend the connection map with connections retrieved from the seed nodes, rather than replacing it entirely.Reduced number of retries on tests to speed them up