Skip to content

Commit

Permalink
Connection to a ScyllaDB cluster is delayed as the driver tries to qu…
Browse files Browse the repository at this point in the history
…ery system.peers_v2 table

The logic is now that if there is sharding information available, it's a Scylla cluster and then do NOT
try to use that table.

Fixes: #245

Signed-off-by: Yaniv Kaul <yaniv.kaul@scylladb.com>
  • Loading branch information
mykaul committed Sep 21, 2023
1 parent d735957 commit 0955b0a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cassandra/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -3668,6 +3668,11 @@ def _try_connect(self, host):
"registering watchers and refreshing schema and topology",
connection)

# Indirect way to determine if conencted to a ScyllaDB cluster, which does not support peers_v2
# If sharding information is available, it's a ScyllaDB cluster, so do not use peers_v2 table.
if connection.sharding_info is not None:
self._uses_peers_v2 = False

# use weak references in both directions
# _clear_watcher will be called when this ControlConnection is about to be finalized
# _watch_callback will get the actual callback from the Connection and relay it to
Expand Down

0 comments on commit 0955b0a

Please sign in to comment.