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 89091363d9e Revert "[chore](log) add try lock db failed log (#34503)"
89091363d9e is described below

commit 89091363d9efd17b07f2c3f5fbd89f311c94505c
Author: yiguolei <yiguo...@gmail.com>
AuthorDate: Fri May 10 17:34:43 2024 +0800

    Revert "[chore](log) add try lock db failed log (#34503)"
    
    This reverts commit e34860b86a1cf0e5aa7afa3633fa3772230e2024.
---
 .../main/java/org/apache/doris/catalog/Database.java    | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Database.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/Database.java
index 2d7359a9f1b..548119dfb71 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Database.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Database.java
@@ -30,8 +30,6 @@ import org.apache.doris.common.io.Text;
 import org.apache.doris.common.io.Writable;
 import org.apache.doris.common.util.DebugUtil;
 import org.apache.doris.common.util.PropertyAnalyzer;
-import org.apache.doris.common.util.QueryableReentrantReadWriteLock;
-import org.apache.doris.common.util.Util;
 import org.apache.doris.datasource.CatalogIf;
 import org.apache.doris.persist.CreateTableInfo;
 import org.apache.doris.persist.gson.GsonUtils;
@@ -60,6 +58,7 @@ import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.stream.Collectors;
 
 /**
@@ -84,8 +83,7 @@ public class Database extends MetaObject implements Writable, 
DatabaseIf<Table>
     private long id;
     @SerializedName(value = "fullQualifiedName")
     private volatile String fullQualifiedName;
-
-    private QueryableReentrantReadWriteLock rwLock;
+    private final ReentrantReadWriteLock rwLock;
 
     // table family group map
     private final Map<Long, Table> idToTable;
@@ -135,7 +133,7 @@ public class Database extends MetaObject implements 
Writable, DatabaseIf<Table>
         if (this.fullQualifiedName == null) {
             this.fullQualifiedName = "";
         }
-        this.rwLock = new QueryableReentrantReadWriteLock(true);
+        this.rwLock = new ReentrantReadWriteLock(true);
         this.idToTable = Maps.newConcurrentMap();
         this.nameToTable = Maps.newConcurrentMap();
         this.lowerCaseToTableName = Maps.newConcurrentMap();
@@ -175,14 +173,7 @@ public class Database extends MetaObject implements 
Writable, DatabaseIf<Table>
 
     public boolean tryWriteLock(long timeout, TimeUnit unit) {
         try {
-            if (!this.rwLock.writeLock().tryLock(timeout, unit)) {
-                Thread owner = this.rwLock.getOwner();
-                if (owner != null) {
-                    LOG.info("database[{}] lock is held by: {}", getName(), 
Util.dumpThread(owner, 10));
-                }
-                return false;
-            }
-            return true;
+            return this.rwLock.writeLock().tryLock(timeout, unit);
         } catch (InterruptedException e) {
             LOG.warn("failed to try write lock at db[" + id + "]", e);
             return false;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to