You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2020/10/29 02:05:38 UTC

[GitHub] [iotdb] mychaow opened a new pull request #1894: limit log size of logDispatcher

mychaow opened a new pull request #1894:
URL: https://github.com/apache/iotdb/pull/1894


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] jt2594838 commented on a change in pull request #1894: limit log size of logDispatcher

Posted by GitBox <gi...@apache.org>.
jt2594838 commented on a change in pull request #1894:
URL: https://github.com/apache/iotdb/pull/1894#discussion_r514944799



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMember.java
##########
@@ -1524,7 +1529,7 @@ private AppendLogResult sendLogToFollowers(Log log, AtomicInteger voteCounter) {
     try {
       if (allNodes.size() > 2) {
         // if there are more than one followers, send the requests in parallel so that one slow
-        // follower will not
+        // follower will not blocked

Review comment:
       be blocked




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] jt2594838 merged pull request #1894: limit log size of logDispatcher

Posted by GitBox <gi...@apache.org>.
jt2594838 merged pull request #1894:
URL: https://github.com/apache/iotdb/pull/1894


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] neuyilan commented on a change in pull request #1894: limit log size of logDispatcher

Posted by GitBox <gi...@apache.org>.
neuyilan commented on a change in pull request #1894:
URL: https://github.com/apache/iotdb/pull/1894#discussion_r514134194



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/log/LogDispatcher.java
##########
@@ -289,32 +294,44 @@ private AppendEntriesRequest prepareRequest(List<ByteBuffer> logList,
 
       request.setEntries(logList);
       // set index for raft
-      request.setPrevLogIndex(currBatch.get(0).getLog().getCurrLogIndex() - 1);
+      request.setPrevLogIndex(currBatch.get(firstIndex).getLog().getCurrLogIndex() - 1);
       try {
-        request.setPrevLogTerm(currBatch.get(0).getAppendEntryRequest().prevLogTerm);
+        request.setPrevLogTerm(currBatch.get(firstIndex).getAppendEntryRequest().prevLogTerm);
       } catch (Exception e) {
         logger.error("getTerm failed for newly append entries", e);
       }
       return request;
     }
 
     private void sendLogs(List<SendLogRequest> currBatch) throws TException {
-      List<ByteBuffer> logList = new ArrayList<>();
-      for (SendLogRequest request : currBatch) {
-        Timer.Statistic.LOG_DISPATCHER_LOG_IN_QUEUE
-            .calOperationCostTimeFromStart(request.getLog().getCreateTime());
-        logList.add(request.getAppendEntryRequest().entry);
-      }
+      int logIndex = 0;
+      logger.info("send logs from index {} to {}", currBatch.get(0).getLog().getCurrLogIndex(),
+        currBatch.get(currBatch.size() - 1).getLog().getCurrLogIndex());
+      while (logIndex < currBatch.size()) {
+        long logSize = IoTDBDescriptor.getInstance().getConfig().getThriftMaxFrameSize();

Review comment:
       maybe we can move the line outside of the while loop




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org