Quanlong Huang has posted comments on this change. ( http://gerrit.cloudera.org:8080/20258 )
Change subject: IMPALA-12305: Fix wrong Catalog Service ID when CatalogD becomes active ...................................................................... Patch Set 1: (3 comments) http://gerrit.cloudera.org:8080/#/c/20258/1/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/20258/1/fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java@245 PS1, Line 245: private final Object catalogServiceIdLock_ = new Object(); I'm not sure if we do need a new lock here. 'catalogServiceId_' comes from JniCatalog which provides JniCatalog.getServiceId() to get it. There is already a lock in JniCatalog protecting the access. Maybe it's simpler to use JniCatalog.getServiceId() directly in getCatalogServiceId() and don't need the new get/set methods. http://gerrit.cloudera.org:8080/#/c/20258/1/fe/src/main/java/org/apache/impala/catalog/CatalogServiceCatalog.java@3534 PS1, Line 3534: synchronized (catalogServiceIdLock_) { This will synchronize all DDL/DMLs that need this id. I think read-write lock might be better since most of the cases are just reading this id. http://gerrit.cloudera.org:8080/#/c/20258/1/fe/src/main/java/org/apache/impala/service/JniCatalog.java File fe/src/main/java/org/apache/impala/service/JniCatalog.java: http://gerrit.cloudera.org:8080/#/c/20258/1/fe/src/main/java/org/apache/impala/service/JniCatalog.java@257 PS1, Line 257: synchronized (catalogServiceIdLock_) { Also suggest chaning this to read-write lock -- To view, visit http://gerrit.cloudera.org:8080/20258 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5eada89052c5f16209c6f16357f30f78b4497434 Gerrit-Change-Number: 20258 Gerrit-PatchSet: 1 Gerrit-Owner: Wenzhe Zhou <[email protected]> Gerrit-Reviewer: Abhishek Rawat <[email protected]> Gerrit-Reviewer: Andrew Sherman <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Quanlong Huang <[email protected]> Gerrit-Comment-Date: Mon, 24 Jul 2023 03:01:30 +0000 Gerrit-HasComments: Yes
