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

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


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 2078d354fbd branch-4.0: [fix](fe) modify tablet cooldownConfLock to 
reduce memory #59356 (#59499)
2078d354fbd is described below

commit 2078d354fbd3f63a8498da3a49fac3c62a0e6729
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Dec 31 11:04:57 2025 +0800

    branch-4.0: [fix](fe) modify tablet cooldownConfLock to reduce memory 
#59356 (#59499)
    
    Cherry-picked from #59356
    
    Co-authored-by: meiyi <[email protected]>
---
 .../src/main/java/org/apache/doris/catalog/Tablet.java   | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java
index 379cc0a17da..0a07ffe82d3 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java
@@ -25,7 +25,6 @@ import org.apache.doris.common.Config;
 import org.apache.doris.common.FeConstants;
 import org.apache.doris.common.Pair;
 import org.apache.doris.common.UserException;
-import org.apache.doris.common.lock.MonitoredReentrantReadWriteLock;
 import org.apache.doris.resource.Tag;
 import org.apache.doris.system.Backend;
 import org.apache.doris.system.SystemInfoService;
@@ -123,7 +122,7 @@ public class Tablet extends MetaObject {
     private long cooldownReplicaId = -1;
     @SerializedName(value = "ctm", alternate = {"cooldownTerm"})
     private long cooldownTerm = -1;
-    private MonitoredReentrantReadWriteLock cooldownConfLock = new 
MonitoredReentrantReadWriteLock();
+    private final Object cooldownConfLock = new Object();
 
     // last time that the tablet checker checks this tablet.
     // no need to persist
@@ -184,10 +183,10 @@ public class Tablet extends MetaObject {
     }
 
     public void setCooldownConf(long cooldownReplicaId, long cooldownTerm) {
-        cooldownConfLock.writeLock().lock();
-        this.cooldownReplicaId = cooldownReplicaId;
-        this.cooldownTerm = cooldownTerm;
-        cooldownConfLock.writeLock().unlock();
+        synchronized (cooldownConfLock) {
+            this.cooldownReplicaId = cooldownReplicaId;
+            this.cooldownTerm = cooldownTerm;
+        }
     }
 
     public long getCooldownReplicaId() {
@@ -195,11 +194,8 @@ public class Tablet extends MetaObject {
     }
 
     public Pair<Long, Long> getCooldownConf() {
-        cooldownConfLock.readLock().lock();
-        try {
+        synchronized (cooldownConfLock) {
             return Pair.of(cooldownReplicaId, cooldownTerm);
-        } finally {
-            cooldownConfLock.readLock().unlock();
         }
     }
 


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

Reply via email to