This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch dev/1.3
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/dev/1.3 by this push:
     new 56fd6ea36cb Shuffle nodeurls to make sure all connections aren't to 
the first node by default #14983 (#14986)
56fd6ea36cb is described below

commit 56fd6ea36cb695ccb0effcaf31ea885dc9b8f528
Author: Potato <[email protected]>
AuthorDate: Fri Feb 28 15:05:21 2025 +0800

    Shuffle nodeurls to make sure all connections aren't to the first node by 
default #14983 (#14986)
    
    Signed-off-by: OneSizeFitQuorum <[email protected]>
---
 .../session/src/main/java/org/apache/iotdb/session/Session.java         | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java 
b/iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java
index d283b1ee066..b7bf5daac0c 100644
--- a/iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java
+++ b/iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java
@@ -412,6 +412,7 @@ public class Session implements ISession {
     if (nodeUrls.isEmpty()) {
       throw new IllegalArgumentException("nodeUrls shouldn't be empty.");
     }
+    Collections.shuffle(nodeUrls);
     this.nodeUrls = nodeUrls;
     this.username = username;
     this.password = password;
@@ -428,6 +429,7 @@ public class Session implements ISession {
       if (builder.nodeUrls.isEmpty()) {
         throw new IllegalArgumentException("nodeUrls shouldn't be empty.");
       }
+      Collections.shuffle(builder.nodeUrls);
       this.nodeUrls = builder.nodeUrls;
       this.enableQueryRedirection = true;
     } else {

Reply via email to