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 2022/08/10 03:11:33 UTC

[GitHub] [iotdb] xingtanzjr commented on a diff in pull request #6836: [IOTDB-4000] Add the control of the size of wal folder in multiLeader consensus.

xingtanzjr commented on code in PR #6836:
URL: https://github.com/apache/iotdb/pull/6836#discussion_r941967805


##########
consensus/src/main/java/org/apache/iotdb/consensus/multileader/MultiLeaderServerImpl.java:
##########
@@ -110,6 +109,17 @@ public void stop() {
    */
   public TSStatus write(IConsensusRequest request) {
     synchronized (stateMachine) {
+      if (needToThrottleDown()) {
+        logger.info(
+            "[Throttle Down] index:{}, safeIndex:{}",
+            getIndex(),
+            getCurrentSafelyDeletedSearchIndex());
+        try {
+          stateMachine.wait(config.getReplication().getThrottleTimeOutMs());
+        } catch (InterruptedException e) {
+          logger.error("Failed to throttle down because ", e);

Review Comment:
   Add `Thread.getCurrentThread.interrupt()`



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