Problem
695a68932f9dfc14293e4b4c868e367740d93244 (issue #1008) factored the local-metadata column
list into _SELECT_LOCAL_COLUMNS and reused it for both local queries:
|
_time = time |
|
|
|
def __init__(self, cluster, timeout, |
|
schema_event_refresh_window, |
|
topology_event_refresh_window, |
Before that commit the two queries had deliberately different column sets:
_SELECT_LOCAL = "SELECT broadcast_address, cluster_name, data_center, host_id, listen_address, partitioner, release_version, rpc_address, schema_version, tokens FROM system.local WHERE key='local'"
_SELECT_LOCAL_NO_TOKENS = "SELECT host_id, cluster_name, data_center, rack, partitioner, release_version, schema_version, rpc_address FROM system.local WHERE key='local'"
_SELECT_LOCAL_NO_TOKENS omitted broadcast_address and listen_address; it now requests
both. It is used whenever token_metadata_enabled=False (cassandra/cluster.py:4133 and
cassandra/cluster.py:4293).
Impact
Against a server whose system.local does not expose those two columns — a proxy, emulator,
or managed service with a reduced system.local — metadata refresh now fails with a
server-side InvalidRequest instead of succeeding. token_metadata_enabled=False was the
only configuration that avoided asking for them.
Confidence
Low, and this should be triaged before any work happens. Arguments against it mattering:
_SELECT_LOCAL already requested both columns, so only a deployment that needs
token_metadata_enabled=False to connect at all is affected.
- The reduced list came in with
d4bf4026 (PYTHON-327, "Cluster config to disable schema and
token processing"), whose stated goal was skipping token processing on large clusters — not
compatibility with a limited system.local. The narrow column set may have been incidental
rather than deliberate.
So this may be purely theoretical. Worth a decision either way, since the previous asymmetry
is the kind of thing that is easy to reintroduce by accident.
Note that #1008's fix assigns host.listen_address from the local row
(cassandra/cluster.py:4398), so a no-tokens path that stopped selecting the column would
leave it None — which is what it did before 695a6893, but the interaction should be
confirmed rather than assumed.
Notes
Found during review of PR #1025; out of that PR's scope (695a6893 is already on master,
and #1008 is closed).
Problem
695a68932f9dfc14293e4b4c868e367740d93244(issue #1008) factored the local-metadata columnlist into
_SELECT_LOCAL_COLUMNSand reused it for both local queries:python-driver/cassandra/cluster.py
Lines 3808 to 3812 in d0d5378
Before that commit the two queries had deliberately different column sets:
_SELECT_LOCAL_NO_TOKENSomittedbroadcast_addressandlisten_address; it now requestsboth. It is used whenever
token_metadata_enabled=False(cassandra/cluster.py:4133andcassandra/cluster.py:4293).Impact
Against a server whose
system.localdoes not expose those two columns — a proxy, emulator,or managed service with a reduced
system.local— metadata refresh now fails with aserver-side
InvalidRequestinstead of succeeding.token_metadata_enabled=Falsewas theonly configuration that avoided asking for them.
Confidence
Low, and this should be triaged before any work happens. Arguments against it mattering:
_SELECT_LOCALalready requested both columns, so only a deployment that needstoken_metadata_enabled=Falseto connect at all is affected.d4bf4026(PYTHON-327, "Cluster config to disable schema andtoken processing"), whose stated goal was skipping token processing on large clusters — not
compatibility with a limited
system.local. The narrow column set may have been incidentalrather than deliberate.
So this may be purely theoretical. Worth a decision either way, since the previous asymmetry
is the kind of thing that is easy to reintroduce by accident.
Note that #1008's fix assigns
host.listen_addressfrom the local row(
cassandra/cluster.py:4398), so a no-tokens path that stopped selecting the column wouldleave it
None— which is what it did before695a6893, but the interaction should beconfirmed rather than assumed.
Notes
Found during review of PR #1025; out of that PR's scope (
695a6893is already on master,and #1008 is closed).