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

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


The following commit(s) were added to refs/heads/master by this push:
     new 4dcca12  [IOTDB-2291] Conccurent modification exception of memtables's 
mods (#4724)
4dcca12 is described below

commit 4dcca126092f4fd45a0668e9c9e74281ed52eb81
Author: Alan Choo <[email protected]>
AuthorDate: Fri Jan 7 09:05:47 2022 +0800

    [IOTDB-2291] Conccurent modification exception of memtables's mods (#4724)
---
 .../java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java  | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
 
b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
index 26ac8a5..0f0d827 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
@@ -1055,6 +1055,7 @@ public class TsFileProcessor {
     }
 
     try {
+      flushQueryLock.writeLock().lock();
       Iterator<Pair<Modification, IMemTable>> iterator = 
modsToMemtable.iterator();
       while (iterator.hasNext()) {
         Pair<Modification, IMemTable> entry = iterator.next();
@@ -1075,6 +1076,8 @@ public class TsFileProcessor {
           "Meet error when writing into ModificationFile file of {} ",
           tsFileResource.getTsFile().getName(),
           e);
+    } finally {
+      flushQueryLock.writeLock().unlock();
     }
 
     if (logger.isDebugEnabled()) {

Reply via email to