You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/07/12 09:34:46 UTC

[iotdb] branch blockInsertOutsideOfWriteLock created (now f4d537633e)

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

haonan pushed a change to branch blockInsertOutsideOfWriteLock
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at f4d537633e Add back the logic of blocking insert before holding writelock

This branch includes the following new commits:

     new 5929d81047 Add back the logic of blocking insert before holding writelock
     new f4d537633e Add back the logic of blocking insert before holding writelock

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/02: Add back the logic of blocking insert before holding writelock

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5929d81047b56ed40c100efbc3e89eadbda9fd17
Author: HTHou <hh...@outlook.com>
AuthorDate: Tue Jul 12 17:28:51 2022 +0800

    Add back the logic of blocking insert before holding writelock
---
 .../org/apache/iotdb/db/engine/storagegroup/DataRegion.java   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
index a419f18373..3fdc1f2991 100755
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
@@ -56,6 +56,7 @@ import org.apache.iotdb.db.exception.BatchProcessException;
 import org.apache.iotdb.db.exception.DataRegionException;
 import org.apache.iotdb.db.exception.DiskSpaceInsufficientException;
 import org.apache.iotdb.db.exception.LoadFileException;
+import org.apache.iotdb.db.exception.StorageEngineException;
 import org.apache.iotdb.db.exception.TriggerExecutionException;
 import org.apache.iotdb.db.exception.TsFileProcessorException;
 import org.apache.iotdb.db.exception.WriteProcessException;
@@ -896,6 +897,9 @@ public class DataRegion {
     if (!isAlive(insertRowNode.getTime())) {
       throw new OutOfTTLException(insertRowNode.getTime(), (System.currentTimeMillis() - dataTTL));
     }
+    if (enableMemControl) {
+      StorageEngineV2.blockInsertionIfReject(null);
+    }
     writeLock("InsertRow");
     try {
       // init map
@@ -1054,7 +1058,9 @@ public class DataRegion {
   @SuppressWarnings("squid:S3776") // Suppress high Cognitive Complexity warning
   public void insertTablet(InsertTabletNode insertTabletNode)
       throws TriggerExecutionException, BatchProcessException, WriteProcessException {
-
+    if (enableMemControl) {
+      StorageEngineV2.blockInsertionIfReject(null);
+    }
     writeLock("insertTablet");
     try {
       TSStatus[] results = new TSStatus[insertTabletNode.getRowCount()];
@@ -3433,6 +3439,9 @@ public class DataRegion {
    */
   public void insert(InsertRowsOfOneDeviceNode insertRowsOfOneDeviceNode)
       throws WriteProcessException, TriggerExecutionException, BatchProcessException {
+    if (enableMemControl) {
+      StorageEngineV2.blockInsertionIfReject(null);
+    }
     writeLock("InsertRowsOfOneDevice");
     try {
       boolean isSequence = false;


[iotdb] 02/02: Add back the logic of blocking insert before holding writelock

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f4d537633eac52a48e0cd2d9cbb51476dfb46997
Author: HTHou <hh...@outlook.com>
AuthorDate: Tue Jul 12 17:34:33 2022 +0800

    Add back the logic of blocking insert before holding writelock
---
 .../main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java    | 1 -
 1 file changed, 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
index 3fdc1f2991..3f0fb4bca8 100755
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
@@ -56,7 +56,6 @@ import org.apache.iotdb.db.exception.BatchProcessException;
 import org.apache.iotdb.db.exception.DataRegionException;
 import org.apache.iotdb.db.exception.DiskSpaceInsufficientException;
 import org.apache.iotdb.db.exception.LoadFileException;
-import org.apache.iotdb.db.exception.StorageEngineException;
 import org.apache.iotdb.db.exception.TriggerExecutionException;
 import org.apache.iotdb.db.exception.TsFileProcessorException;
 import org.apache.iotdb.db.exception.WriteProcessException;