You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by lt...@apache.org on 2019/05/27 12:45:11 UTC

[incubator-iotdb] branch cluster updated: fix a bug of read data

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

lta pushed a commit to branch cluster
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/cluster by this push:
     new 20b05ae  fix a bug of read data
20b05ae is described below

commit 20b05aeed202aaaf3916f9f203a54729e8ad9a6e
Author: lta <li...@163.com>
AuthorDate: Mon May 27 20:44:53 2019 +0800

    fix a bug of read data
---
 .../apache/iotdb/cluster/qp/executor/AbstractQPExecutor.java   |  2 +-
 .../main/java/org/apache/iotdb/cluster/utils/RaftUtils.java    | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/qp/executor/AbstractQPExecutor.java b/cluster/src/main/java/org/apache/iotdb/cluster/qp/executor/AbstractQPExecutor.java
index 9b2da09..033bfca 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/qp/executor/AbstractQPExecutor.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/qp/executor/AbstractQPExecutor.java
@@ -158,7 +158,7 @@ public abstract class AbstractQPExecutor {
         throw new RaftConnectionException(
             String.format("Can not connect to remote node : %s", task.getTargetNode()));
       } else if (task.getTaskState() == TaskState.REDIRECT) {
-        /** redirect to the right leader **/
+        // redirect to the right leader
         leader = PeerId.parsePeer(task.getResponse().getLeaderStr());
         LOGGER.debug("Redirect leader: {}, group id = {}", leader, task.getRequest().getGroupID());
         RaftUtils.updateRaftGroupLeader(task.getRequest().getGroupID(), leader);
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/utils/RaftUtils.java b/cluster/src/main/java/org/apache/iotdb/cluster/utils/RaftUtils.java
index 59fddf8..f9901b8 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/utils/RaftUtils.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/utils/RaftUtils.java
@@ -418,7 +418,7 @@ public class RaftUtils {
     handleNullReadToDataGroup(status, server, nullReadTask, groupId);
   }
 
-  private static void handleNullReadToDataGroup(Status status, Server server,
+  private static void handleNullReadToDataGroup(Status resultStatus, Server server,
       SingleQPTask nullReadTask, String groupId) {
     try {
       LOGGER.debug("Handle null-read in data group for reading.");
@@ -432,16 +432,16 @@ public class RaftUtils {
               BasicResponse response = DataGroupNonQueryResponse
                   .createEmptyResponse(groupId);
               if (!status.isOk()) {
-                status.setCode(-1);
-                status.setErrorMsg(status.getErrorMsg());
+                resultStatus.setCode(-1);
+                resultStatus.setErrorMsg(status.getErrorMsg());
               }
               nullReadTask.receive(response);
             }
           });
       nullReadTask.await();
     } catch (InterruptedException e) {
-      status.setCode(-1);
-      status.setErrorMsg(e.getMessage());
+      resultStatus.setCode(-1);
+      resultStatus.setErrorMsg(e.getMessage());
     }
   }