mirror of
https://github.com/apache/impala.git
synced 2026-02-02 06:00:36 -05:00
In IMPALA-12286, catalogd re-generate its Catalog Service ID in JniCatalog when it becomes active. But CatalogServiceCatalog is not updated when new Catalog Service ID is generated. This causes coordinator hanging when processing DDLs. In CatalogServer class, is_active_ is not protected by mutex catalog_lock_, and pending_topic_updates_ is not cleared when the catalogd becomes active. It's possible catalog server sends pending catalog topic updates with old Catalog Service ID then sends catalog topic updates with new Catalog Service ID. This patch removes catalogServiceId_ from CatalogServiceCatalog, and makes CatalogServiceCatalog to call JniCatalog.getServiceId() directly. It makes is_active_ to be protected by mutex catalog_lock_, and makes catalog server to clear pending_topic_updates_ when the catalogd becomes active. Testing: - Added more queries in test cases for CatalogD HA. Verified that test cases failed without fix, and test cases were passed after fix. - Passed core tests. Change-Id: I5eada89052c5f16209c6f16357f30f78b4497434 Reviewed-on: http://gerrit.cloudera.org:8080/20258 Reviewed-by: Andrew Sherman <asherman@cloudera.com> Reviewed-by: Riza Suminto <riza.suminto@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>