absurdfarce commented on PR #2036:
URL: 
https://github.com/apache/cassandra-java-driver/pull/2036#issuecomment-3215800631

   Thanks for the fixes @lukasz-antoniak.  I can confirm that these fixes 
address the ConnectionInitExceptions I mentioned in my prior message.
   
   There's still something that has been gnawing at me about this impl but 
despite a hefty amount of effort I haven't been able to cleanly articulate my 
concern.  I _think_ at the core it's the idea that we implement an extra 
interface (LocalDcAwareLoadBalancingPolicy) here to indicate that an LBP is 
aware of it's local DC, a change that in general I completely agree with.  But 
then we say that this functionality can only be determined in _some_ cases 
(i.e. if a user configures a DC in some way).  This covers the default case but 
that's only due to the implementation of DefaultLoadBalancingPolicy.  We have 
an extension of the default policy named 
[DcInferringLoadBalancingPolicy](https://github.com/apache/cassandra-java-driver/blob/4.19.0/core/src/main/java/com/datastax/oss/driver/internal/core/loadbalancing/DcInferringLoadBalancingPolicy.java)
 which will try to "infer" the local DC (based on contact points) if nothing is 
specified.  This LBP may or may not have a value... again, it d
 epends entirely on the impl.  It's a similar story for custom LBP impls.
   
   A reasonable question to ask here is "if we change 
LocalDcAwareLoadBalancingPolicy.getLocalDatacenter() to return an 
Optional<String> rather than a String doesn't that address the problem?"  Maybe 
it does... and I think that might be a very reasonable change.  But it's not 
_completely_ satisfying; we're still saying we have this whole interface 
because an LBP is aware of it's local DC... until it's not.
   
   I'm still not explaining this very well, and for that I apologize.
   
   @aratno does _any_ of this resonate for you or am I just nuts?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to