Quanlong Huang has posted comments on this change. ( http://gerrit.cloudera.org:8080/15260 )
Change subject: IMPALA-9357: Fix race condition in alter_database event ...................................................................... Patch Set 3: (6 comments) http://gerrit.cloudera.org:8080/#/c/15260/3/fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java File fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java: http://gerrit.cloudera.org:8080/#/c/15260/3/fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java@435 PS3, Line 435: database Could you change this to "database object"? http://gerrit.cloudera.org:8080/#/c/15260/3/fe/src/main/java/org/apache/impala/catalog/Db.java File fe/src/main/java/org/apache/impala/catalog/Db.java: http://gerrit.cloudera.org:8080/#/c/15260/3/fe/src/main/java/org/apache/impala/catalog/Db.java@29 PS3, Line 29: import java.util.concurrent.locks.ReentrantLock; nit: move it up into the "java.util" group http://gerrit.cloudera.org:8080/#/c/15260/3/fe/src/main/java/org/apache/impala/catalog/Db.java@529 PS3, Line 529: public void addToVersionsForInflightEvents(long versionNumber) { Could you add a check that current thread is holding dbLock_ here? Preconditions.checkState(dbLock_.isHeldByCurrentThread()); I think we need to check this too in all places using inFlightEvents_, e.g. removeFromVersionsForInflightEvents, because now we have both dbLock_ and metastoreDdlLock_. It's possible we mess it up somewhere... http://gerrit.cloudera.org:8080/#/c/15260/3/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java File fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java: http://gerrit.cloudera.org:8080/#/c/15260/3/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java@211 PS3, Line 211: Db-level "Db-level" shows like the whole db including all the underlying tables to me. I think we need to mention this is just for the db object or db metadata, not including metadata of underlying tables. http://gerrit.cloudera.org:8080/#/c/15260/3/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java@1286 PS3, Line 1286: synchronized (metastoreDdlLock_) { Should this be replaced with the db lock as well? http://gerrit.cloudera.org:8080/#/c/15260/3/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java@2028 PS3, Line 2028: synchronized (metastoreDdlLock_) { Same here. I think we should acquire the db lock instead. -- To view, visit http://gerrit.cloudera.org:8080/15260 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I472fd8a55740769ee5cdb84e48422a4ab39a8d1e Gerrit-Change-Number: 15260 Gerrit-PatchSet: 3 Gerrit-Owner: Vihang Karajgaonkar <vih...@cloudera.com> Gerrit-Reviewer: Anurag Mantripragada <anu...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Quanlong Huang <huangquanl...@gmail.com> Gerrit-Comment-Date: Tue, 03 Mar 2020 08:40:48 +0000 Gerrit-HasComments: Yes