Closed Bouncheck closed 1 month ago
@Bouncheck , I have been thinking about this solution, more I think less I like it. This solution to feed hosts to controll connection when it reconnects looks hacky to me. I think driver should sync initial contact points to the list of nodes on node events (UP/DOWN/ADD/DEL). Let's discuss it.
@Bouncheck , I see that you still use newQueryPlan
at one particular place, can you please switch to newControlReconnectionQueryPlan
Queue<Node> nodes = context.getLoadBalancingPolicyWrapper().newQueryPlan();
@Bouncheck , I have been thinking about this solution, more I think less I like it. This solution to feed hosts to controll connection when it reconnects looks hacky to me. I think driver should sync initial contact points to the list of nodes on node events (UP/DOWN/ADD/DEL). Let's discuss it.
Regarding this, I have tried to do it, unfortunately due to the API this fix will be extremely intrusive, let's go ahead with your solution.
@Bouncheck , I see that you still use
newQueryPlan
at one particular place, can you please switch tonewControlReconnectionQueryPlan
Queue<Node> nodes = context.getLoadBalancingPolicyWrapper().newQueryPlan();
Yes, but it's during the initialization. I believe that part works fine.
@Bouncheck , I see that you still use
newQueryPlan
at one particular place, can you please switch tonewControlReconnectionQueryPlan
Queue<Node> nodes = context.getLoadBalancingPolicyWrapper().newQueryPlan();
Yes, but it's during the initialization. I believe that part works fine.
It works fine, but creates unnecessary confusion.
I reverted that 1 call in ControlConnection init back to newQueryPlan()
. I forgot that removing it would require changing around 20 test methods which expect that exact api call
I can adjust them, but I don't know if it's worth it
I can adjust them, but I don't know if it's worth it
Please check last commit and tell if you are ok with it.
Adds additional config option that changes behavior of ControlConnection's reconnection. In case LBP returns an empty query plan we will attempt to connect to the original endpoints regardless of their last observed status.
The option is by default disabled and driver without enabling it should keep behaving the same way as before. If enabled it should be possible to reconnect to the cluster if all endpoints containing hostnames were lost during normal operation and then cluster was replaced.