diff --git a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java index ff162b0c9fa522..14105232e0f581 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java +++ b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBEnvironment.java @@ -336,6 +336,11 @@ public void removeDatabase(String dbName) { // get journal db names and sort the names public List getDatabaseNames() { + // The operation before may set the current thread as interrupted. + // MUST reset the interrupted flag of current thread to false, + // otherwise replicatedEnvironment.getDatabaseNames() will fail because it will call lock.tryLock(), + // which will check the interrupted flag. + Thread.interrupted(); List ret = new ArrayList(); List names = null; int tried = 0; diff --git a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java index 1c1bcf6354cb69..2a6a5b201e0258 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java +++ b/fe/fe-core/src/main/java/org/apache/doris/journal/bdbje/BDBJEJournal.java @@ -225,6 +225,11 @@ public synchronized long write(JournalBatch batch) throws IOException { @Override public synchronized long write(short op, Writable writable) throws IOException { + // The operation before may set the current thread as interrupted. + // MUST reset the interrupted flag of current thread to false, + // otherwise edit log writing may fail because it will call lock.tryLock(), + // which will check the interrupted flag. + Thread.interrupted(); JournalEntity entity = new JournalEntity(); entity.setOpCode(op); entity.setData(writable);