You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add config options for advanced shard awareness
Adds config options for toggling the feature on and defining
port ranges to use.
By default the feature will be enabled.
* Copy 3.x PortAllocator
* Extend ChannelFactory methods with shardId params
With advanced shard awareness target shard is a necessary parameter
for connecting. Extends non public methods with new parameters and
provides one additional public method.
Passing `null` as shard id or ShardingInfo will lead to previous non-shard
aware behavior.
* Enable advanced shard awareness
Makes `addMissingChannels` use advanced shard awareness.
It will now specify target shard when adding missing channels for
specific shards.
In case returned channels do not match requested shards warnings are logged.
Initial connection to the node works on previous rules, meaning it uses
arbitrary local port for connection to arbitrary shard.
Adds AdvancedShardAwarenessIT that has several methods displaying
the difference between establishing connections with option enabled
and disabled.
Adds ChannelPoolShardAwareInitTest
inttargetShard = port % channel.getShardingInfo().getShardsCount();
577
+
if (actualShard != targetShard) {
578
+
LOG.warn(
579
+
"[{}] New channel {} connected to shard {}, but shard {} was requested. If this is not transient check your driver AND cluster configuration of shard aware port.",
580
+
logPrefix,
581
+
channel,
582
+
actualShard,
583
+
targetShard);
584
+
}
585
+
}
554
586
LOG.debug("[{}] New channel added {}", logPrefix, channel);
555
587
if (channels[channel.getShardId()].size() < wantedCount) {
0 commit comments