yomipq commented on issue #1873:
URL: 
https://github.com/apache/cassandra-gocql-driver/issues/1873#issuecomment-2764853848

   I'm trying `DisableInitialHostLookup`. Although there are some parts I'm not 
sure, it's working fine.
   
   ```
   2025/03/28 08:28:50 gocql: Session.handleNodeConnected: 172.16.1.28:9142
   2025/03/28 08:28:50 gocql: Session.handleNodeConnected: 172.16.1.14:9142
   2025/03/28 08:28:50 gocql: conns of pool after stopped "172.16.1.14": 2
   2025/03/28 08:28:50 gocql: conns of pool after stopped "172.16.1.28": 2
   2025/03/28 08:29:50 
Session.ring:[172.16.1.28:UP][172.16.1.14:UP][172.16.1.28:UP]
   
   ...
   
   2025/03/29 20:19:33 gocql: unable to refresh ring: get existing 
host=[HostInfo hostname="" connectAddress="172.16.1.28" peer="172.16.1.28" 
rpc_address="172.16.1.28" broadcast_address="<nil>" preferred_ip="172.16.1.28" 
connect_addr="172.16.1.28" connect_addr_source="connect_address" port=9142 
data_centre="ap-northeast-1" rack="ap-northeast-1" 
host_id="b666465e-cb85-3efa-b3ab-f6cf139e5a39" version="v3.11.2" state=UP 
num_tokens=1] from prevHosts: cannot find host
   2025/03/29 20:19:33 gocql: Session.handleNodeConnected: 172.16.1.14:9142
   2025/03/29 20:19:33 gocql: conns of pool after stopped "172.16.1.28": 0
   2025/03/29 20:19:33 gocql: conns of pool after stopped "172.16.1.14": 2
   2025/03/29 20:19:50 
Session.ring:[172.16.1.14:UP][172.16.1.28:UP][172.16.1.14:UP][127.0.0.1:DOWN]
   ```
   
   On startup, it had 3 connections, including 2 connections to 172.16.1.28, 
for some reason. After the error `cannot find host` on the connection to 
172.16.1.28, it had 4 connections, including 2 connections to 172.16.1.14 and 1 
connection to 127.0.0.1 that was down.
   
   I'm not sure if this is a normal behavior or not, but it's working.
   
   By the way, I came up with another work around. It might be a better 
solution to add a HostFilter in cluster config to ignore 127.0.0.1:
   
   ```
   cluster.HostFilter = gocql.HostFilterFunc(func (h *gocql.HostInfo) bool {
           return h.ConnectAddress().String() != "127.0.0.1"
   })
   ```
   
   So far it's working fine after refreshRing, I will keep it for a while 
longer.


-- 
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: commits-unsubscr...@cassandra.apache.org

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


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

Reply via email to