Problem
Schema v1 has two node-preference slots, both $ref-ing #/$defs/node-location-preference:
query.load-balancing.node-preference — "Defines part of the cluster queries will be scheduled on"
connection.node-preference — "Defines part of the cluster driver holds connections to"
DRIVER_CONFIG phase 2 (#997) emits only the first (cassandra/driver_config.py:1004). The
connection group (_connection_report, :1243) carries no node-preference at all, so an
operator reading the report cannot tell which nodes the driver actually holds pools to.
The two are not the same value. Pool membership is decided by ProfileManager.distance()
(cassandra/cluster.py:479), which is the union across every execution profile:
distances = set(p.load_balancing_policy.distance(host) for p in self.profiles.values())
and DCAwareRoundRobinPolicy.distance (cassandra/policies.py:278) returns IGNORED for a
remote-DC host while used_hosts_per_remote_dc == 0. So with the default of 0 no pool opens
outside the local DC, while a profile pinned to another DC widens the pool set without
changing what the default profile's query.load-balancing.node-preference says.
Every other ScyllaDB/Cassandra driver reports this: java-driver 4.x from
toDatacenterPreference(), csharp across profiles, gocql from the HostFilter.
What to decide
- Divergent profiles. A single
node-location-preference object cannot express "dc1 for
profile A, dc2 for profile B". Omitting the key when profiles disagree is probably right —
the schema makes it optional — but it needs stating and testing.
- Which policy in a chain.
_survey_policy_chain (:832) already walks _child_policy
and hands back the location-aware link; the connection-level answer has to do that per
profile, not once.
pools_allowed. ProfileManager.distance short-circuits to IGNORED when it is false,
i.e. the driver holds no pools at all. The schema has no way to say that.
Reusable pieces
_node_location_preference_report(policy) (cassandra/driver_config.py:872) already builds
the value from a policy and needs no change.
_survey_policy_chain(policy) (:832) finds the location-aware link in a chain.
tests/resources/driver-config-schema-v1.json already defines the key, so this is a
reporting gap, not a schema change.
Why it is not in #997
Raised there as a review question and deliberately deferred: it is a new key with the
profile-aggregation question above to settle, and #997 is already +6348/-73.
Refs: #997 (comment)
Problem
Schema v1 has two
node-preferenceslots, both$ref-ing#/$defs/node-location-preference:query.load-balancing.node-preference— "Defines part of the cluster queries will be scheduled on"connection.node-preference— "Defines part of the cluster driver holds connections to"DRIVER_CONFIG phase 2 (#997) emits only the first (
cassandra/driver_config.py:1004). Theconnectiongroup (_connection_report,:1243) carries nonode-preferenceat all, so anoperator reading the report cannot tell which nodes the driver actually holds pools to.
The two are not the same value. Pool membership is decided by
ProfileManager.distance()(
cassandra/cluster.py:479), which is the union across every execution profile:and
DCAwareRoundRobinPolicy.distance(cassandra/policies.py:278) returnsIGNOREDfor aremote-DC host while
used_hosts_per_remote_dc == 0. So with the default of 0 no pool opensoutside the local DC, while a profile pinned to another DC widens the pool set without
changing what the default profile's
query.load-balancing.node-preferencesays.Every other ScyllaDB/Cassandra driver reports this: java-driver 4.x from
toDatacenterPreference(), csharp across profiles, gocql from theHostFilter.What to decide
node-location-preferenceobject cannot express "dc1 forprofile A, dc2 for profile B". Omitting the key when profiles disagree is probably right —
the schema makes it optional — but it needs stating and testing.
_survey_policy_chain(:832) already walks_child_policyand hands back the location-aware link; the connection-level answer has to do that per
profile, not once.
pools_allowed.ProfileManager.distanceshort-circuits toIGNOREDwhen it is false,i.e. the driver holds no pools at all. The schema has no way to say that.
Reusable pieces
_node_location_preference_report(policy)(cassandra/driver_config.py:872) already buildsthe value from a policy and needs no change.
_survey_policy_chain(policy)(:832) finds the location-aware link in a chain.tests/resources/driver-config-schema-v1.jsonalready defines the key, so this is areporting gap, not a schema change.
Why it is not in #997
Raised there as a review question and deliberately deferred: it is a new key with the
profile-aggregation question above to settle, and #997 is already +6348/-73.
Refs: #997 (comment)