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

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

                Author: ASF GitHub Bot
            Created on: 14/Feb/20 05:19
            Start Date: 14/Feb/20 05:19
    Worklog Time Spent: 10m 
      Work Description: maheshk114 commented on pull request #899: HIVE-22844 
Add validation and retry logic in cm
URL: https://github.com/apache/hive/pull/899#discussion_r379252079
 
 

 ##########
 File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/ReplChangeManager.java
 ##########
 @@ -156,23 +156,31 @@ private ReplChangeManager(Configuration conf) throws 
MetaException {
           cmRootDir = MetastoreConf.getVar(conf, ConfVars.REPLCMDIR);
           encryptedCmRootDir = MetastoreConf.getVar(conf, 
ConfVars.REPLCMENCRYPTEDDIR);
           fallbackNonEncryptedCmRootDir = MetastoreConf.getVar(conf, 
ConfVars.REPLCMFALLBACKNONENCRYPTEDDIR);
+          //validate cmRootEncrypted is absolute
+          Path cmRootEncrypted = new Path(encryptedCmRootDir);
+          if (cmRootEncrypted.isAbsolute()) {
+            throw new MetaException(ConfVars.REPLCMENCRYPTEDDIR.getHiveName() 
+ " should be a relative path");
+          }
+          Path cmRootFallback = new Path(fallbackNonEncryptedCmRootDir);
+          if (!cmRootFallback.isAbsolute()) {
+            throw new MetaException(ConfVars.REPLCMENCRYPTEDDIR.getHiveName() 
+ " should be absolute path");
+          }
           //Create default cm root
           Path cmroot = new Path(cmRootDir);
           createCmRoot(cmroot);
           FileSystem cmRootFs = cmroot.getFileSystem(conf);
           HdfsEncryptionShim pathEncryptionShim = hadoopShims
                   .createHdfsEncryptionShim(cmRootFs, conf);
-          Path cmRootEncrypted = new Path(encryptedCmRootDir);
-          if (cmRootEncrypted.isAbsolute()) {
-            throw new MetaException(ConfVars.REPLCMENCRYPTEDDIR.getHiveName() 
+ " should be a relative path");
-          }
           if (pathEncryptionShim.isPathEncrypted(cmroot)) {
             //If cm root is encrypted we keep using it for the encryption zone
             String encryptionZonePath = cmRootFs.getUri()
                     + 
pathEncryptionShim.getEncryptionZoneForPath(cmroot).getPath();
-            encryptionZones.put(encryptionZonePath, cmRootDir);
+            encryptionZoneToCmrootMapping.put(encryptionZonePath, cmRootDir);
           } else {
-            encryptionZones.put(NO_ENCRYPTION, cmRootDir);
+            encryptionZoneToCmrootMapping.put(NO_ENCRYPTION, cmRootDir);
+          }
+          if (cmRootFs.exists(cmRootFallback) && 
pathEncryptionShim.isPathEncrypted(cmRootFallback)) {
 
 Review comment:
   what if whole hdfs root is encrypted and user does not want non-encrypted 
CMroot ?
 
----------------------------------------------------------------
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:
[email protected]


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

    Worklog Id:     (was: 387141)
    Time Spent: 20m  (was: 10m)

> Validate cm configs, add retries in fs apis for cm
> --------------------------------------------------
>
>                 Key: HIVE-22844
>                 URL: https://issues.apache.org/jira/browse/HIVE-22844
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Aasha Medhi
>            Assignee: Aasha Medhi
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-22844.patch, HIVE-22844.patch, HIVE-22844.patch, 
> HIVE-22844.patch, HIVE-22844.patch, HIVE-22844.patch
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> # Retry create cm root logic
>  # Rename encryptionZones to cmRootLocations to be more accurate
>  # Check cmRootEncrypted.isAbsolute() first before we go for creating anything
>  # Validate fallbackNonEncryptedCmRootDir if it's really not encrypted
>  # Refactor deleteTableData logic



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

Reply via email to