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 2021/08/31 02:20:58 UTC

[GitHub] [iotdb] neuyilan commented on a change in pull request #3832: [IOTDB-1583] Raft log failed to be committed in cluster version

neuyilan commented on a change in pull request #3832:
URL: https://github.com/apache/iotdb/pull/3832#discussion_r698933792



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/server/member/RaftMember.java
##########
@@ -1032,6 +1032,15 @@ TSStatus processPlanLocally(PhysicalPlan plan) {
       log.setCurrLogTerm(getTerm().get());
       log.setCurrLogIndex(logManager.getLastLogIndex() + 1);
 
+      // if a single log exceeds the threshold
+      // we need to return error code to the client as in server mode
+      if (log.serialize().capacity() + Integer.BYTES
+          >= ClusterDescriptor.getInstance().getConfig().getRaftLogBufferSize()) {
+        logger.error(
+            "Log cannot fit into buffer, please increase raft_log_buffer_size;"
+                + "or reduce the size of requests you send.");

Review comment:
       I think this needs further discussion, is some error happened during raft log `apply`, maybe only one raft group failed, it will lose some data, and cause the raft group not consistent with each other, how to deal with the exception?
   
   For now, I think it ok just throw the exception and not let the log be committed.
   




-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

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