From f97c0c48643dc53e334194ebfd59cd18887d80e0 Mon Sep 17 00:00:00 2001 From: sylwiaszunejko Date: Thu, 12 Oct 2023 10:44:03 +0200 Subject: [PATCH] Mark node as down if unable to dial control conn Without this if during restart the resources assigned to node change, the driver does not update this. That could lead to outdated information about threads/shards. --- control.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/control.go b/control.go index 47ec7abaf..fe2ce06e3 100644 --- a/control.go +++ b/control.go @@ -401,6 +401,9 @@ func (c *controlConn) attemptReconnectToAnyOfHosts(hosts []*HostInfo) (*Conn, er for _, host := range hosts { conn, err = c.session.connect(c.session.ctx, host, c) if err != nil { + if c.session.cfg.ConvictionPolicy.AddFailure(err, host) { + c.session.handleNodeDown(host.ConnectAddress(), host.Port()) + } c.session.logger.Printf("gocql: unable to dial control conn %v:%v: %v\n", host.ConnectAddress(), host.Port(), err) continue }