java-driver icon indicating copy to clipboard operation
java-driver copied to clipboard

PoolingOptions - should they be adhered when the server support Scylla Shard Extenstions

Open slivne opened this issue 6 years ago • 3 comments

When a client connect to a server supporting the Scylla Protocol Extension for Intranode Sharding the driver will open connections to each shard

A client can also setup PoolingOptions

It is not clear the interaction between the two and if PoolingOptions should be adhered or not.

One solution is to disregard PoolingOptions altogether is Intranode Sharding is available.

slivne avatar Aug 14 '19 15:08 slivne

The interaction is as follows:

  1. Pooling options set core connections per host and max connections per host
  2. If shard awareness is enabled then each shard gets coreConnectionsSize / shardsCount + (coreConnectionsSize % shardsCount > 0 ? 1 : 0) connections but we still try to respect max connections per host by not adding new connections when sum of shard's connections exceeds max connections per host.

Does that explain the matter enough or do you have any additional questions @slivne?

haaawk avatar Aug 23 '19 08:08 haaawk

@slivne ping. Would you like me to do anything with this or can we close the issue?

haaawk avatar May 14 '20 16:05 haaawk

Documentation should be updated (https://github.com/scylladb/java-driver/tree/latest/manual/pooling#configuring-the-connection-pool), we can't tell users to read the driver's code

kbr- avatar Dec 02 '20 15:12 kbr-