You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2021/07/18 08:36:03 UTC

[iotdb] branch autoai_debug updated: test could reproduce?

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

qiaojialin pushed a commit to branch autoai_debug
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/autoai_debug by this push:
     new be9a82f  test could reproduce?
be9a82f is described below

commit be9a82f5947bef2d248223254b0bf8f93844c575
Author: qiaojialin <64...@qq.com>
AuthorDate: Sun Jul 18 16:35:25 2021 +0800

    test could reproduce?
---
 .../db/writelog/node/ExclusiveWriteLogNode.java    | 71 +++++++++++-----------
 1 file changed, 36 insertions(+), 35 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java b/server/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java
index 2f0fc92..cf998db 100644
--- a/server/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java
@@ -105,12 +105,12 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
     if (deleted) {
       throw new IOException("WAL node deleted");
     }
-    long start = System.currentTimeMillis();
+    //    long start = System.currentTimeMillis();
     lock.lock();
-    long elapse = System.currentTimeMillis() - start;
-    if (elapse > 5000) {
-      logger.warn("[wal] ExclusiveWriteLogNode lock got cost: {}ms", elapse);
-    }
+    //    long elapse = System.currentTimeMillis() - start;
+    //    if (elapse > 5000) {
+    //      logger.warn("[wal] ExclusiveWriteLogNode lock got cost: {}ms", elapse);
+    //    }
     try {
       putLog(plan);
       if (bufferedLogNum >= config.getFlushWalThreshold()) {
@@ -243,9 +243,9 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
   }
 
   private void forceWal() {
-    logger.warn("[wal] {} forceWal try to start", this.hashCode());
+    //    logger.warn("[wal] {} forceWal try to start", this.hashCode());
     lock.lock();
-    logger.warn("[wal] {} forceWal start", this.hashCode());
+    //    logger.warn("[wal] {} forceWal start", this.hashCode());
     try {
       try {
         if (currentFileWriter != null) {
@@ -256,14 +256,14 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
       }
     } finally {
       lock.unlock();
-      logger.warn("[wal] {} forceWal end", this.hashCode());
+      //      logger.warn("[wal] {} forceWal end", this.hashCode());
     }
   }
 
   private void sync() {
-    logger.warn("[wal] {} sync try to start", this.hashCode());
+    //    logger.warn("[wal] {} sync try to start", this.hashCode());
     lock.lock();
-    logger.warn("[wal] {} sync start", this.hashCode());
+    //    logger.warn("[wal] {} sync start", this.hashCode());
     try {
       if (bufferedLogNum == 0) {
         return;
@@ -282,13 +282,13 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
       logger.warn("can not found file {}", identifier, e);
     } finally {
       lock.unlock();
-      logger.warn("[wal] {} sync end", this.hashCode());
+      //      logger.warn("[wal] {} sync end", this.hashCode());
     }
   }
 
   private void flushBuffer(ILogWriter writer) {
-    logger.warn("[wal] {} flushBuffer start", this.hashCode());
-    long start = System.currentTimeMillis();
+    //    logger.warn("[wal] {} flushBuffer start", this.hashCode());
+    //    long start = System.currentTimeMillis();
     try {
       writer.write(logBufferFlushing);
     } catch (ClosedChannelException e) {
@@ -297,12 +297,13 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
       logger.warn("Log node {} sync failed, change system mode to read-only", identifier, e);
       IoTDBDescriptor.getInstance().getConfig().setReadOnly(true);
       return;
-    } finally {
-      long elapse = System.currentTimeMillis() - start;
-      if (elapse > 5000) {
-        logger.error("[wal] flushBuffer cost: {}ms", elapse);
-      }
     }
+    //    finally {
+    //      long elapse = System.currentTimeMillis() - start;
+    //      if (elapse > 5000) {
+    //        logger.error("[wal] flushBuffer cost: {}ms", elapse);
+    //      }
+    //    }
     logBufferFlushing.clear();
 
     try {
@@ -310,11 +311,11 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
     } catch (InterruptedException e) {
       Thread.currentThread().interrupt();
     }
-    logger.warn("[wal] {} flushBuffer end", this.hashCode());
+    //    logger.warn("[wal] {} flushBuffer end", this.hashCode());
   }
 
   private void switchBufferWorkingToFlushing() throws InterruptedException {
-    logger.warn("[wal] {} switchBufferWorkingToFlushing start", this.hashCode());
+    //    logger.warn("[wal] {} switchBufferWorkingToFlushing start", this.hashCode());
     long start = System.currentTimeMillis();
     synchronized (switchBufferCondition) {
       while (logBufferFlushing != null && !deleted) {
@@ -328,12 +329,12 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
     if (elapse > 5000) {
       logger.error("[wal] switch Working -> Flushing cost: {}ms", elapse);
     }
-    logger.warn("[wal] {} switchBufferWorkingToFlushing end", this.hashCode());
+    //    logger.warn("[wal] {} switchBufferWorkingToFlushing end", this.hashCode());
   }
 
   private void switchBufferIdleToWorking() throws InterruptedException {
-    logger.warn("[wal] {} switchBufferIdleToWorking start", this.hashCode());
-    long start = System.currentTimeMillis();
+    //    logger.warn("[wal] {} switchBufferIdleToWorking start", this.hashCode());
+    //    long start = System.currentTimeMillis();
     synchronized (switchBufferCondition) {
       while (logBufferIdle == null && !deleted) {
         switchBufferCondition.wait(100);
@@ -342,16 +343,16 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
       logBufferIdle = null;
       switchBufferCondition.notifyAll();
     }
-    long elapse = System.currentTimeMillis() - start;
-    if (elapse > 5000) {
-      logger.error("[wal] switch Idle -> Working cost: {}ms", elapse);
-    }
-    logger.warn("[wal] {} switchBufferIdleToWorking end", this.hashCode());
+    //    long elapse = System.currentTimeMillis() - start;
+    //    if (elapse > 5000) {
+    //      logger.error("[wal] switch Idle -> Working cost: {}ms", elapse);
+    //    }
+    //    logger.warn("[wal] {} switchBufferIdleToWorking end", this.hashCode());
   }
 
   private void switchBufferFlushingToIdle() throws InterruptedException {
-    logger.warn("[wal] {} switchBufferFlushingToIdle start", this.hashCode());
-    long start = System.currentTimeMillis();
+    //    logger.warn("[wal] {} switchBufferFlushingToIdle start", this.hashCode());
+    //    long start = System.currentTimeMillis();
     synchronized (switchBufferCondition) {
       while (logBufferIdle != null && !deleted) {
         switchBufferCondition.wait(100);
@@ -361,11 +362,11 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
       logBufferFlushing = null;
       switchBufferCondition.notifyAll();
     }
-    long elapse = System.currentTimeMillis() - start;
-    if (elapse > 5000) {
-      logger.error("[wal] switch Flushing -> Idle cost: {}ms", elapse);
-    }
-    logger.warn("[wal] {} switchBufferFlushingToIdle end", this.hashCode());
+    //    long elapse = System.currentTimeMillis() - start;
+    //    if (elapse > 5000) {
+    //      logger.error("[wal] switch Flushing -> Idle cost: {}ms", elapse);
+    //    }
+    //    logger.warn("[wal] {} switchBufferFlushingToIdle end", this.hashCode());
   }
 
   private ILogWriter getCurrentFileWriter() throws FileNotFoundException {