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

commit ec34bc0386a8605ae37796767d55f8a071f8861e
Author: xy720 <[email protected]>
AuthorDate: Thu May 9 18:09:07 2024 +0800

    [bug](config) Fix modifying label_num_threshold does not take effect 
(#34575)
---
 fe/fe-common/src/main/java/org/apache/doris/common/Config.java     | 6 ++++--
 .../java/org/apache/doris/transaction/DatabaseTransactionMgr.java  | 7 +------
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java 
b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
index 00344e4934e..26708488ad7 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
+++ b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java
@@ -2541,10 +2541,12 @@ public class Config extends ConfigBase {
     public static int http_load_submitter_max_worker_threads = 2;
 
     @ConfField(mutable = true, masterOnly = true, description = {
-            "load label个数阈值,超过该个数后,对于已经完成导入作业或者任务,其label会被删除,被删除的 label 
可以被重用。",
+            "load label个数阈值,超过该个数后,对于已经完成导入作业或者任务,"
+            + "其label会被删除,被删除的 label 可以被重用。 值为 -1 时,表示此阈值不生效。",
             "The threshold of load labels' number. After this number is 
exceeded, "
                     + "the labels of the completed import jobs or tasks will 
be deleted, "
-                    + "and the deleted labels can be reused."
+                    + "and the deleted labels can be reused. "
+                    + "When the value is -1, it indicates no threshold."
     })
     public static int label_num_threshold = 2000;
 
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
 
b/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
index 745ee91af84..6d53148e5af 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
@@ -170,8 +170,6 @@ public class DatabaseTransactionMgr {
 
     private long lockReportingThresholdMs = Config.lock_reporting_threshold_ms;
 
-    private long maxFinalTxnsNum = Long.MAX_VALUE;
-
     private void readLock() {
         this.transactionLock.readLock().lock();
     }
@@ -195,9 +193,6 @@ public class DatabaseTransactionMgr {
         this.env = env;
         this.idGenerator = idGenerator;
         this.editLog = env.getEditLog();
-        if (Config.label_num_threshold >= 0) {
-            this.maxFinalTxnsNum = Config.label_num_threshold;
-        }
     }
 
     public long getDbId() {
@@ -1728,7 +1723,7 @@ public class DatabaseTransactionMgr {
                 break;
             }
         }
-        while (finalStatusTransactionStateDeque.size() > maxFinalTxnsNum
+        while ((Config.label_num_threshold > 0 && 
finalStatusTransactionStateDeque.size() > Config.label_num_threshold)
                 && numOfClearedTransaction < left) {
             TransactionState transactionState = 
finalStatusTransactionStateDeque.getFirst();
             if (transactionState.getFinishTime() != -1) {


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

Reply via email to