Closed kbr-scylla closed 8 months ago
@kbr-scylla This issue have two parts:
WhiteListRoundRobinPolicy
does not support unix domain sockets (this PR address that: https://github.com/scylladb/python-driver/pull/287)cqlsh
does not work not only because WhiteListRoundRobinPolicy
, but also because in cqlsh
there is no mention that this contact point is UnixSocketEndPoint
as it should be, you can see that on that example:
from cassandra.cluster import Cluster
from cassandra.connection import UnixSocketEndPoint
from cassandra.policies import HostFilterPolicy, RoundRobinPolicy
socket = "<node's workdir>/cql.m" cluster = Cluster([UnixSocketEndPoint(socket)],
load_balancing_policy=HostFilterPolicy(RoundRobinPolicy(), lambda h: h.address == socket))
session = cluster.connect()
with `WhiteListRoundRobinPolicy` it should look like that:
```python
from cassandra.cluster import Cluster
from cassandra.connection import UnixSocketEndPoint
from cassandra.policies import HostFilterPolicy, RoundRobinPolicy
socket = "<node's workdir>/cql.m"
cluster = Cluster([UnixSocketEndPoint(socket)],
# Driver tries to connect to other nodes in the cluster, so we need to filter them out.
load_balancing_policy=WhiteListRoundRobinPolicy([UnixSocketEndPoint(socket)])
session = cluster.connect()
so there is a need to introduce a way to cqlsh
to recognize if hostname
is a unix domain socket and if it is it should wrap self.hostname
(here: https://github.com/scylladb/scylla-cqlsh/blob/426fa0eaa72b7d46115188b1af9cdd983b923241/bin/cqlsh.py#L488,L491) in UnixSocketEndPoint
.
@kbr-scylla @avelanarius I addressed second part of this issue in https://github.com/scylladb/scylla-cqlsh/pull/67
Most prominent example of this is when we try to use
cqlsh
to connect to Scylla maintenance socket (currently queued on next): https://github.com/scylladb/scylladb/issues/16489A workaround is possible (using
HostFilterPolicy
), but sincecqlsh
usesWhiteListRoundRobinPolicy
, we need to fix it.