This is an automated email from the ASF dual-hosted git repository.
awong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new 5291221 KUDU-3154: add policy to Ranger before authorizing
5291221 is described below
commit 5291221ecea6b892364720342eb15c64bcf41e95
Author: Andrew Wong <[email protected]>
AuthorDate: Thu Jul 9 23:08:59 2020 -0700
KUDU-3154: add policy to Ranger before authorizing
For whatever reason, in some environments, we've seen the Kudu Ranger
plugin hang when downloading policies. It isn't exactly clear why this
happens but one workaround we've seen is to add a policy to Ranger
before authorizing any requests. This patch adds the workaround to the
only Ranger test that suffers from this.
Change-Id: Ice0b3842335e5854835542e18b41c54509c2fc33
Reviewed-on: http://gerrit.cloudera.org:8080/16166
Reviewed-by: Alexey Serbin <[email protected]>
Tested-by: Kudu Jenkins
Reviewed-by: Attila Bukor <[email protected]>
---
src/kudu/ranger/ranger_client-test.cc | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/kudu/ranger/ranger_client-test.cc
b/src/kudu/ranger/ranger_client-test.cc
index eee44b8..b063b29 100644
--- a/src/kudu/ranger/ranger_client-test.cc
+++ b/src/kudu/ranger/ranger_client-test.cc
@@ -350,6 +350,19 @@ class RangerClientTestBase : public KuduTest {
Status InitializeRanger() {
ranger_.reset(new MiniRanger("127.0.0.1"));
RETURN_NOT_OK(ranger_->Start());
+ // Create a policy so the Ranger client policy refresher can pick something
+ // up. In some environments the absense of policies can cause the plugin to
+ // wait for a policy to appear indefinitely.
+ // See KUDU-3154 and RANGER-2899 for more details.
+ // TODO(awong): remove this when RANGER-2899 is fixed.
+ PolicyItem item;
+ item.first.emplace_back("user");
+ item.second.emplace_back(ActionPB::METADATA);
+ AuthorizationPolicy policy;
+ policy.databases.emplace_back("db");
+ policy.tables.emplace_back("table");
+ policy.items.emplace_back(std::move(item));
+ RETURN_NOT_OK(ranger_->AddPolicy(std::move(policy)));
RETURN_NOT_OK(ranger_->CreateClientConfig(test_dir_));
client_.reset(new RangerClient(env_, metric_entity_));
return client_->Start();