cluster: add control-connection query fallback#878
Conversation
88b0f45 to
82a5b3c
Compare
82a5b3c to
4eb62ce
Compare
|
cqlsh manual test report I tested cqlsh with the local driver from Test setup: This setup makes the initial control connection reachable, but makes discovered node-pool connections unusable. Results:
Default With I also verified directly through the driver that the session starts with no node pools and still executes the query: With Conclusion: |
d14ab6c to
a94d092
Compare
b50342a to
5f16f20
Compare
5f16f20 to
a37ecce
Compare
Lorak-mmk
left a comment
There was a problem hiding this comment.
I have to admit I don't understand the logic and flow around _control_connection_query_attempted. I'll have to just assume it works.
I have 2 more questions regarding SkipPoolCreation:
- WDYT about changing
ProfileManagerto returnIGNOREDdistance for all hosts in this mode? It would be additional hardening about unexpected code paths doing something weird. One possible problem is that it may affect control connection, in which case we should not do it. - I think
Cluster.on_upandCluster.on_downshould also be guarded inSkipPoolCreationmode. We don't want reconnectors to start etc.
a37ecce to
16424dc
Compare
Great idea, easily can see how it can stop driver spin on pool creation, added. |
Add an opt-in control-connection fallback for application queries when the driver cannot populate normal node pools, which happens in deployments that expose the cluster through a non-broadcast IP address such as a TCP proxy or a node public IP. In that mode the driver can still execute queries over the single control connection, but throughput is poor and connection churn increases the chance of request errors. This option is intentionally disabled by default and should not be used in production. Also propagate keyspace updates on the fallback path so USE keeps the control connection in sync. Tests: - tests/unit/test_cluster.py::ClusterTest::test_set_keyspace_for_all_pools_reports_all_errors - tests/unit/test_response_future.py::ResponseFutureTests::test_control_connection_fallback_updates_connection_keyspace
16424dc to
b0e8df1
Compare
| "Simple keyspace names should not be quoted, got: %r" % query) | ||
|
|
||
| @mock_session_pools | ||
| <<<<<<< HEAD |
Summary
Add an opt-in control-connection fallback for application queries when the driver cannot populate normal node pools, which happens in deployments that expose the cluster through a non-broadcast IP address such as a TCP proxy or a node public IP. In that mode the driver can still execute queries over the single control connection, but throughput is poor and connection churn increases the chance of request errors. This option is intentionally disabled by default and should not be used in production.
Also propagate keyspace updates on the fallback path so
USEkeeps the control connection in sync.Fixes: #720
Tests
uv run python - <<\"PY\" ... pytest tests/unit/test_cluster.py -q -k set_keyspace_for_all_pools_reports_all_errors ... PYuv run python - <<\"PY\" ... pytest tests/unit/test_response_future.py -q -k control_connection_fallback_updates_connection_keyspace ... PY