[ 
https://issues.apache.org/jira/browse/HIVE-25086?focusedWorklogId=609265&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-609265
 ]

ASF GitHub Bot logged work on HIVE-25086:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Jun/21 17:10
            Start Date: 09/Jun/21 17:10
    Worklog Time Spent: 10m 
      Work Description: aasha commented on a change in pull request #2240:
URL: https://github.com/apache/hive/pull/2240#discussion_r648504479



##########
File path: common/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java
##########
@@ -627,7 +627,9 @@
   REPL_INVALID_ARGUMENTS(40012, "Invalid arguments error : {0}.", true),
   REPL_INVALID_ALTER_TABLE(40013, "{0}Unable to alter table{1}", true),
   REPL_PERMISSION_DENIED(40014, 
"{0}org.apache.hadoop.security.AccessControlException{1}", true),
-  REPL_DISTCP_SNAPSHOT_EXCEPTION(40015, "SNAPSHOT_ERROR", true)
+  REPL_DISTCP_SNAPSHOT_EXCEPTION(40015, "SNAPSHOT_ERROR", true),
+  RANGER_AUTHORISATION_FAILED(40016, "Authorisation Failure while 
communicating to Ranger admin", true),

Review comment:
       type : authorization

##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ranger/RangerRestClientImpl.java
##########
@@ -202,12 +238,14 @@ public RangerExportPolicyList 
importRangerPolicies(RangerExportPolicyList ranger
     String finalUrl = getRangerImportUrl(baseUrl, dbName);
     LOG.debug("URL to import policies on target Ranger: {}", finalUrl);
     Retryable retryable = Retryable.builder()
-      .withHiveConf(hiveConf)
-      .withRetryOnException(Exception.class).build();
+      .withHiveConf(hiveConf).withFailOnException(RuntimeException.class)
+      .withRetryOnException(SemanticException.class).build();
     try {
       return retryable.executeCallable(() -> 
importRangerPoliciesPlain(jsonRangerExportPolicyList,
               rangerPoliciesJsonFileName,
               serviceMapJsonFileName, jsonServiceMap, finalUrl, 
rangerExportPolicyList, hiveConf));
+    } catch (RuntimeException e) {

Review comment:
       you are catching a runtime exception and throwing a semantic exception. 
why are you doing that?

##########
File path: common/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java
##########
@@ -627,7 +627,9 @@
   REPL_INVALID_ARGUMENTS(40012, "Invalid arguments error : {0}.", true),
   REPL_INVALID_ALTER_TABLE(40013, "{0}Unable to alter table{1}", true),
   REPL_PERMISSION_DENIED(40014, 
"{0}org.apache.hadoop.security.AccessControlException{1}", true),
-  REPL_DISTCP_SNAPSHOT_EXCEPTION(40015, "SNAPSHOT_ERROR", true)
+  REPL_DISTCP_SNAPSHOT_EXCEPTION(40015, "SNAPSHOT_ERROR", true),
+  RANGER_AUTHORISATION_FAILED(40016, "Authorisation Failure while 
communicating to Ranger admin", true),

Review comment:
       error code is same. it should be different. Check if any of the existing 
errror codes that can be reused.

##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ranger/RangerRestClientImpl.java
##########
@@ -90,11 +86,13 @@ public RangerExportPolicyList exportRangerPolicies(String 
sourceRangerEndpoint,
         "cannot be empty", ReplUtils.REPL_RANGER_SERVICE));
     }
     Retryable retryable = Retryable.builder()
-      .withHiveConf(hiveConf)
-      .withRetryOnException(Exception.class).build();
+      .withHiveConf(hiveConf).withFailOnException(RuntimeException.class)
+      .withRetryOnException(URISyntaxException.class).build();

Review comment:
       what is the use of retry in case of URISyntaxException?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 609265)
    Time Spent: 4h  (was: 3h 50m)

> Create Ranger Deny Policy for replication db in all cases if 
> hive.repl.ranger.target.deny.policy is set to true.
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-25086
>                 URL: https://issues.apache.org/jira/browse/HIVE-25086
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: Haymant Mangla
>            Assignee: Haymant Mangla
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 4h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to