zhannngchen commented on code in PR #17965:
URL: https://github.com/apache/doris/pull/17965#discussion_r1141971425


##########
fe/fe-common/src/main/java/org/apache/doris/common/Config.java:
##########
@@ -2070,5 +2070,11 @@ public class Config extends ConfigBase {
      */
     @ConfField
     public static String bdbje_file_logging_level = "ALL";
+
+    /**
+     * When the acquire/held lock time exceeds the threshold, need to report 
it.
+     */
+    @ConfField
+    public static long lock_reporting_threshold_ms = 500l;

Review Comment:
   It's too large, I think 1000ms is big enough



##########
fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java:
##########
@@ -141,20 +143,30 @@ public class DatabaseTransactionMgr {
 
     // not realtime usedQuota value to make a fast check for database data 
quota
     private volatile long usedQuotaDataBytes = -1;
+    private long lockWriteStart;
+
+    private long lockReportingThresholdMs = Config.lock_reporting_threshold_ms;
 
     protected void readLock() {
+        long waitReadStart = System.currentTimeMillis();
         this.transactionLock.readLock().lock();
+        checkAndLogWaitTime(waitReadStart, System.currentTimeMillis());

Review Comment:
   It's not necessary to log readlock wait time, long wait time is always 
caused by some thread holding writelock too long, and further more, if some 
thread hold's writelock for a long time, after it unlocked, there's lots of 
threads get the readlock, they all print such log, especially with stacktrace, 
which is quite slow.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to