Skip to content

4.x: Advanced shard awareness #515

@Bouncheck

Description

@Bouncheck

I've looked through the existing issues and haven't found any related specifically to implementing this feature.

Advanced shard awareness is a feature that speeds up connection creation. It uses Scylla's shard-aware port on which Scylla chooses target shard based on the connection's source port. AFAIK it was never implemented in 4.x version of the driver.
3.x makes use of it by explicitly setting local port on boostrap.connect(...):

future = bootstrap.connect(serverAddress, new InetSocketAddress(localPort));

In 4.x it's not being used right now:
ChannelFuture connectFuture = bootstrap.connect(endPoint.resolve());

Evidence for it not working right now:
Started 16 shard Scylla node and run 6 session initializations simultaneously. With 9042 port multiple reconnection attempts can be observed in debug logs before initializing full 16 channel pool. This is expected and was checked for reference.

With 19042 port it seems that driver gets stuck on 8/16 channels. This is a weird result, but if advanced shard awareness was in use it should not be happening either way. I was expecting a number of reconnections of the similar order as number of random d16 dice rolls until rolling every number.

Expected result with advanced shard awareness enabled would be driver initializing all channels without considerable number of reconnections for all sessions, ideally none.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions