This is an automated email from the ASF dual-hosted git repository.

kunalkapoor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/carbondata.git


The following commit(s) were added to refs/heads/master by this push:
     new d7435a2  [Carbondata-3999] Fix permission issue of indexServerTmp 
directory
d7435a2 is described below

commit d7435a289b96d81a72cc2f31c55122bb6f6481f8
Author: Karan980 <[email protected]>
AuthorDate: Fri Oct 9 10:40:24 2020 +0530

    [Carbondata-3999] Fix permission issue of indexServerTmp directory
    
    Why is this PR needed?
    When dir "/indexservertmp" is not existing,then select query with
    indexserver will create a dir "/indexservertmp/[queryid]" with
    permission 755,and the permission of dir "/indexservertmp" is also
    755,it will cause permission issue.
    
    What changes were proposed in this PR?
    When select query with indexserver,first check if the dir "/indexservertmp"
    is existing,and if not,then create dir "/indexservertmp" with permission 777
    
    This closes #3974
---
 .../java/org/apache/carbondata/core/util/CarbonUtil.java    | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java 
b/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
index db04841..c5dc8c3 100644
--- a/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
+++ b/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
@@ -3254,14 +3254,13 @@ public final class CarbonUtil {
   public static CarbonFile createTempFolderForIndexServer(String queryId)
           throws IOException {
     final String path = getIndexServerTempPath();
+    if (!FileFactory.isFileExist(path)) {
+      // Create the new index server temp directory if it does not exist
+      LOGGER.info("Creating Index Server temp folder:" + path);
+      FileFactory.createDirectoryAndSetPermission(path,
+              new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.ALL));
+    }
     if (queryId == null) {
-      if (!FileFactory.isFileExist(path)) {
-        // Create the new index server temp directory if it does not exist
-        LOGGER.info("Creating Index Server temp folder:" + path);
-        FileFactory
-                .createDirectoryAndSetPermission(path,
-                        new FsPermission(FsAction.ALL, FsAction.ALL, 
FsAction.ALL));
-      }
       return null;
     }
     CarbonFile file = FileFactory.getCarbonFile(path + 
CarbonCommonConstants.FILE_SEPARATOR

Reply via email to