IMPALA-7137 fixup: only recreate AuthorizationChecker on full delta updates
This is a follow-up to commit a90b42911f1753b14e4f9f581bad837e33dcf9bf which had an unintended side-effect even when LocalCatalog is not enabled: previously we would only re-instantiate AuthorizationChecker on "full" catalog updates; after that patch, we would re-instantiate it on every catalog update. While it appears that this is relatively cheap and didn't cause any obvious behavioral changes, it wasn't intended, and one of the goals of the --use_local_catalog flag being optional is that the existing code paths shouldn't be affected. So, this puts it back the way it was. Thanks to Adam Holley for noticing this and alerting me to my mistake. Change-Id: I47f5945fd64c0adf3fe7fd82076f64672358f962 Reviewed-on: http://gerrit.cloudera.org:8080/11357 Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Reviewed-by: Todd Lipcon <t...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/impala/repo Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/37c080bf Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/37c080bf Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/37c080bf Branch: refs/heads/master Commit: 37c080bfa8f11542450045e35f99bb132ac8296c Parents: 8dcf54a Author: Todd Lipcon <t...@apache.org> Authored: Wed Aug 29 16:43:55 2018 -0700 Committer: Todd Lipcon <t...@apache.org> Committed: Thu Sep 6 02:39:08 2018 +0000 ---------------------------------------------------------------------- fe/src/main/java/org/apache/impala/service/Frontend.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/impala/blob/37c080bf/fe/src/main/java/org/apache/impala/service/Frontend.java ---------------------------------------------------------------------- diff --git a/fe/src/main/java/org/apache/impala/service/Frontend.java b/fe/src/main/java/org/apache/impala/service/Frontend.java index e259631..0ae5044 100644 --- a/fe/src/main/java/org/apache/impala/service/Frontend.java +++ b/fe/src/main/java/org/apache/impala/service/Frontend.java @@ -244,8 +244,12 @@ public class Frontend { public TUpdateCatalogCacheResponse updateCatalogCache( TUpdateCatalogCacheRequest req) throws CatalogException, TException { TUpdateCatalogCacheResponse resp = catalogManager_.updateCatalogCache(req); - authzChecker_.set(new AuthorizationChecker( - authzConfig_, getCatalog().getAuthPolicy())); + if (!req.is_delta) { + // In the case that it was a non-delta update, the catalog might have reloaded + // itself, and we need to reset the AuthorizationChecker accordingly. + authzChecker_.set(new AuthorizationChecker( + authzConfig_, getCatalog().getAuthPolicy())); + } return resp; }