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

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 2c7e5cae9a8 branch-2.1: [fix](catalog) Fix mark handling for failed 
tasks to maintain getLeftMarks #46205 (#46256)
2c7e5cae9a8 is described below

commit 2c7e5cae9a8d218a5365c4e8e22bf7022755ff6a
Author: walter <[email protected]>
AuthorDate: Thu Jan 2 16:39:43 2025 +0800

    branch-2.1: [fix](catalog) Fix mark handling for failed tasks to maintain 
getLeftMarks #46205 (#46256)
    
    cherry pick from #46205
---
 be/src/olap/data_dir.cpp                                       |  2 +-
 .../java/org/apache/doris/common/MarkedCountDownLatch.java     | 10 +++++++++-
 .../src/main/java/org/apache/doris/master/MasterImpl.java      |  2 +-
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/be/src/olap/data_dir.cpp b/be/src/olap/data_dir.cpp
index 98bc721c048..13238a6dc1e 100644
--- a/be/src/olap/data_dir.cpp
+++ b/be/src/olap/data_dir.cpp
@@ -515,7 +515,7 @@ Status DataDir::load() {
     }
     if (rowset_partition_id_eq_0_num > 
config::ignore_invalid_partition_id_rowset_num) {
         LOG(FATAL) << fmt::format(
-                "roswet partition id eq 0 is {} bigger than config {}, be 
exit, plz check be.INFO",
+                "rowset partition id eq 0 is {} bigger than config {}, be 
exit, plz check be.INFO",
                 rowset_partition_id_eq_0_num, 
config::ignore_invalid_partition_id_rowset_num);
         exit(-1);
     }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/common/MarkedCountDownLatch.java 
b/fe/fe-core/src/main/java/org/apache/doris/common/MarkedCountDownLatch.java
index e1431c4d729..5c3201e2b80 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/MarkedCountDownLatch.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/MarkedCountDownLatch.java
@@ -28,11 +28,13 @@ import java.util.concurrent.CountDownLatch;
 public class MarkedCountDownLatch<K, V> extends CountDownLatch {
 
     private Multimap<K, V> marks;
+    private Multimap<K, V> failedMarks;
     private Status st = Status.OK;
 
     public MarkedCountDownLatch(int count) {
         super(count);
         marks = HashMultimap.create();
+        failedMarks = HashMultimap.create();
     }
 
     public synchronized void addMark(K key, V value) {
@@ -54,7 +56,13 @@ public class MarkedCountDownLatch<K, V> extends 
CountDownLatch {
             st = status;
         }
 
-        if (marks.remove(key, value)) {
+        // Since marks are used to determine whether a task is completed, we 
should not remove
+        // a mark if the task has failed rather than finished. To maintain the 
idempotency of
+        // this method, we store failed marks in a separate map.
+        //
+        // Search `getLeftMarks` for details.
+        if (!failedMarks.containsEntry(key, value)) {
+            failedMarks.put(key, value);
             super.countDown();
             return true;
         }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java 
b/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java
index 96cba77857f..7a6787d360b 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/master/MasterImpl.java
@@ -647,7 +647,7 @@ public class MasterImpl {
         }
 
         AlterInvertedIndexTask alterInvertedIndexTask = 
(AlterInvertedIndexTask) task;
-        LOG.info("beigin finish AlterInvertedIndexTask: {}, tablet: {}, 
toString: {}",
+        LOG.info("begin finish AlterInvertedIndexTask: {}, tablet: {}, 
toString: {}",
                 alterInvertedIndexTask.getSignature(),
                 alterInvertedIndexTask.getTabletId(),
                 alterInvertedIndexTask.toString());


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to