Dimitris Tsirogiannis has posted comments on this change. Change subject: IMPALA-4020: Catalog update can fail due to database creation/deletion in hive ......................................................................
Patch Set 1: (2 comments) http://gerrit.cloudera.org:8080/#/c/4161/1/fe/src/main/java/com/cloudera/impala/catalog/CatalogServiceCatalog.java File fe/src/main/java/com/cloudera/impala/catalog/CatalogServiceCatalog.java: PS1, Line 568: try { indentation if off by 2 :) PS1, Line 590: msClient.getHiveClient().getAllTables(dbName) What will happen if the database is dropped sometime before L588 and L590? I think we will get into this state where the database that we know got dropped is added to the catalog. I understand that we can't really ensure atomicity here but I think we should try to avoid creating inconsistent states as much as possible. First of all, I would extract the logic of invalidating the database into a separate private function. Then I would check if that 'invalidateDb' finished successfully or threw the exception and in the latter case, I would clean up the catalog cache (if an entry was added). We don't have to worry about concurrent operations because this function already has a write lock on the catalog. -- To view, visit http://gerrit.cloudera.org:8080/4161 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic228efbcceb9ef6c165d0d9aeef7202581e3e46a Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: anujphadke <[email protected]> Gerrit-Reviewer: Bharath Vissapragada <[email protected]> Gerrit-Reviewer: Dimitris Tsirogiannis <[email protected]> Gerrit-HasComments: Yes
