You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "hust-hhb (via GitHub)" <gi...@apache.org> on 2023/03/20 10:50:58 UTC

[GitHub] [doris] hust-hhb opened a new pull request, #17965: [feature](log)check and log acquire/held lock time when it exceeds threshold

hust-hhb opened a new pull request, #17965:
URL: https://github.com/apache/doris/pull/17965

   Sometimes the competition of lock is fierce in DatabaseTransactionMgr, which may lead to publish time out, i think we should have a log to hint these lock competition.
   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   Describe your changes.
   
   ## Checklist(Required)
   
   * [ ] Does it affect the original behavior
   * [ ] Has unit tests been added
   * [ ] Has document been added or modified
   * [ ] Does it need to update dependencies
   * [ ] Is this PR support rollback (If NO, please explain WHY)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] github-actions[bot] commented on pull request #17965: [feature](log)check and log holding lock time when it exceeds threshold

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #17965:
URL: https://github.com/apache/doris/pull/17965#issuecomment-1482208396

   PR approved by at least one committer and no changes requested.


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] hust-hhb commented on a diff in pull request #17965: [feature](log)check and log acquire/held lock time when it exceeds threshold

Posted by "hust-hhb (via GitHub)" <gi...@apache.org>.
hust-hhb commented on code in PR #17965:
URL: https://github.com/apache/doris/pull/17965#discussion_r1143225500


##########
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:
   Thanks for comment, i have changed the code.
   I agree to remove lock wait time, and i thinks it's only necessary to record the time of holding write lock, which is sufficient to reflect to situation of lock.



-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] yiguolei merged pull request #17965: [feature](log)check and log holding lock time when it exceeds threshold

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #17965:
URL: https://github.com/apache/doris/pull/17965


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] github-actions[bot] commented on pull request #17965: [feature](log)check and log holding lock time when it exceeds threshold

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #17965:
URL: https://github.com/apache/doris/pull/17965#issuecomment-1482208427

   PR approved by anyone and no changes requested.


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] hust-hhb commented on pull request #17965: [feature](log)check and log holding lock time when it exceeds threshold

Posted by "hust-hhb (via GitHub)" <gi...@apache.org>.
hust-hhb commented on PR #17965:
URL: https://github.com/apache/doris/pull/17965#issuecomment-1479401382

   run buildall


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] hello-stephen commented on pull request #17965: [feature](log)check and log holding lock time when it exceeds threshold

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #17965:
URL: https://github.com/apache/doris/pull/17965#issuecomment-1480447718

   TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 34.89 seconds
    stream load tsv:          467 seconds loaded 74807831229 Bytes, about 152 MB/s
    stream load json:         24 seconds loaded 2358488459 Bytes, about 93 MB/s
    stream load orc:          76 seconds loaded 1101869774 Bytes, about 13 MB/s
    stream load parquet:          33 seconds loaded 861443392 Bytes, about 24 MB/s
    https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230323011234_clickbench_pr_119032.html


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] zhannngchen commented on pull request #17965: [feature](log)check and log holding lock time when it exceeds threshold

Posted by "zhannngchen (via GitHub)" <gi...@apache.org>.
zhannngchen commented on PR #17965:
URL: https://github.com/apache/doris/pull/17965#issuecomment-1482208331

   run buildall


-- 
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-unsubscribe@doris.apache.org

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


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


[GitHub] [doris] zhannngchen commented on a diff in pull request #17965: [feature](log)check and log acquire/held lock time when it exceeds threshold

Posted by "zhannngchen (via GitHub)" <gi...@apache.org>.
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-unsubscribe@doris.apache.org

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


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