You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/11/27 07:20:06 UTC

[GitHub] [incubator-doris] caiconghui commented on a change in pull request #3775: Support read and write lock in table level to reduce lock competition

caiconghui commented on a change in pull request #3775:
URL: https://github.com/apache/incubator-doris/pull/3775#discussion_r531420212



##########
File path: fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
##########
@@ -2043,12 +2044,7 @@ public long saveDb(DataOutputStream dos, long checksum) throws IOException {
             // Don't write information_schema db meta
             if (!InfoSchemaDb.isInfoSchemaDb(dbName)) {
                 checksum ^= entry.getKey();
-                db.readLock();
-                try {
-                    db.write(dos);
-                } finally {
-                    db.readUnlock();
-                }
+                db.write(dos);

Review comment:
       for Catalog dumpImage or saveImage will call this function. for the first, lock all dbs already. for second, only invoke by checkpoint thread, so it is thread safe




----------------------------------------------------------------
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.

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