mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-24 22:09:24 +00:00
Start transport client round-robin randomly
This commit modifies the initial value of the transport client round-robin index to a random value so that initial requests are more likely to not all hit the same node. Relates #14143
This commit is contained in:
parent
c9da56dc80
commit
ebe616988a
@ -20,6 +20,7 @@
|
||||
package org.elasticsearch.client.transport;
|
||||
|
||||
import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||
|
||||
import org.elasticsearch.ExceptionsHelper;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
@ -33,6 +34,7 @@ import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.Randomness;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -95,7 +97,7 @@ public class TransportClientNodesService extends AbstractComponent implements Cl
|
||||
|
||||
private volatile ScheduledFuture nodesSamplerFuture;
|
||||
|
||||
private final AtomicInteger randomNodeGenerator = new AtomicInteger();
|
||||
private final AtomicInteger randomNodeGenerator = new AtomicInteger(Randomness.get().nextInt());
|
||||
|
||||
private final boolean ignoreClusterName;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user