Connection pool size configuration #281
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #240
Ref: #132
Depends on: #280 (I need metrics support to implement one integration test).<- already on masterImplements:
cass_cluster_set_core_connections_per_host
cass_cluster_set_core_connections_per_shard
(as an extension to cpp-driver API)Integration tests
Existing ErrorsConnectionTimeouts metrics test
I don't know who implemented this test, but (IMO) it's just wrong. So my understanding of intentions is:
If those were the intentions, the
EXPECT_GE(2u, metrics.errors.connection_timeouts);
is wrong - it should be the other way around. Currently it expects2 >= connection_timeouts
.Ok, so let's say we fix it. It still won't work with rust driver. The
Session
object will not even be built - we will fail to open a control connection (because of timeouts) and fail to fetch the metadata. In particular, we won't even be able to callSession::get_metrics()
- thecass_session_get_metrics
will return early with some log error message.Thus, I'm not enabling this test.
Fun fact: in my local setup, this test passes. Even though, the connect timeout is low, it is not triggered. And then, the
metrics.errors.connection_timeouts
is 0 - this means that aforementioned assertion passes as well.My new
StatsShardConnections
metrics testI implemented simple test where we configure a pool size to be 2 connections per shard (
cass_cluster_set_core_connections_per_shard
). It checks whether all connections are registered in the metrics. The expected value is at leastnr_hosts * nr_shards * 2
.Pre-review checklist
[ ] I have implemented Rust unit tests for the features/changes introduced..github/workflows/build.yml
ingtest_filter
..github/workflows/cassandra.yml
ingtest_filter
.