You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: detect ScyllaDB via SUPPORTED protocol extensions, not shard count
The driver previously identified ScyllaDB by the presence of shard-related
fields (SCYLLA_NR_SHARDS, SCYLLA_SHARD, etc.) in the SUPPORTED response.
When shard-awareness is disabled on the server side
(allow_shard_aware_drivers: false) those fields are absent, causing the
driver to misidentify a ScyllaDB cluster as Cassandra. The immediate
consequence is that the driver enables peers_v2 (which ScyllaDB does not
support) and fails to connect -- the same regression described in
scylladb/gocql#902.
Fix (mirrors scylladb/gocql#903):
* Add ProtocolFeatures.is_scylla: set to True whenever ANY known
Scylla-specific extension key (SCYLLA_LWT_ADD_METADATA_MARK,
SCYLLA_RATE_LIMIT_ERROR, TABLETS_ROUTING_V1) is present in the
SUPPORTED response, or whenever sharding_info is populated. This
flag stays True even when sharding is disabled.
* ProtocolFeatures.sharding_info remains None when sharding is disabled,
so shard-aware connection pooling (pool.py) is correctly left inactive.
* cluster.py: use is_scylla (not sharding_info is not None) to gate the
peers_v2 disable and the USING TIMEOUT metadata request timeout.
* metadata.py _is_not_scylla(): use is_scylla instead of the previous
check (shard_id is None), which was always False after the OPTIONS
exchange and therefore silently broke Cassandra trigger-metadata queries.
* protocol_features.py parse_sharding_info(): fix a latent crash -- if
SCYLLA_PARTITIONER or SCYLLA_SHARDING_ALGORITHM were present without
SCYLLA_SHARD, int(None) would raise TypeError. Default shard_id to 0.
Fixes: scylladb/python-driver#<TBD>
See also: scylladb/gocql#902, scylladb/gocql#903Fixes: #909
0 commit comments