scylladb / gocql

Package gocql implements a fast and robust ScyllaDB client for the Go programming language.
https://docs.scylladb.com/stable/using-scylla/drivers/cql-drivers/scylla-go-driver.html
BSD 3-Clause "New" or "Revised" License
169 stars 47 forks source link

Add the datacenter name validation if provided #206

Closed sylwiaszunejko closed 1 week ago

sylwiaszunejko commented 1 week ago

Previously there was no check if DC name provided in the policy (DCAware and RackAware) is correct. That could lead to e.g. making routing decisions based on the wrong DC name.

This PR introduces failing to connect if DC name is different in the topology than the one the user entered.

Fixes: #205

sylwiaszunejko commented 1 week ago

@mykaul @Lorak-mmk I pushed the new version with IsOperational(*Session) error API and additional check for rack. Is it what you had in mind @dkropachev ?