Przeglądaj źródła

Merge -r 646981:646982 from trunk to branch-0.17 to fix HADOOP-3182

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.17@646985 13f79535-47bb-0310-9956-ffa450edef68
Arun Murthy 17 lat temu
rodzic
commit
c607b09de7

+ 4 - 0
CHANGES.txt

@@ -570,6 +570,10 @@ Release 0.16.3 - Unreleased
     HADOOP-3069. Primary name-node should not truncate image when transferring
     it from the secondary. (shv)
 
+    HADOOP-3182. Change permissions of the job-submission directory to 777
+    from 733 to ensure sharing of HOD clusters works correctly. (Tsz Wo
+    (Nicholas), Sze and Amareshwari Sri Ramadasu via acmurthy) 
+
 Release 0.16.2 - 2008-04-02
 
   BUG FIXES

+ 4 - 4
src/java/org/apache/hadoop/mapred/JobClient.java

@@ -545,7 +545,7 @@ public class JobClient extends Configured implements MRConstants, Tool  {
     fs.delete(submitJobDir, true);
     submitJobDir = fs.makeQualified(submitJobDir);
     submitJobDir = new Path(submitJobDir.toUri().getPath());
-    FsPermission mapredSysPerms = new FsPermission(SYSTEM_DIR_PERMISSION);
+    FsPermission mapredSysPerms = new FsPermission(JOB_DIR_PERMISSION);
     FileSystem.mkdirs(fs, submitJobDir, mapredSysPerms);
     Path filesDir = new Path(submitJobDir, "files");
     Path archivesDir = new Path(submitJobDir, "archives");
@@ -671,9 +671,9 @@ public class JobClient extends Configured implements MRConstants, Tool  {
   final private static FsPermission JOB_FILE_PERMISSION = 
     FsPermission.createImmutable((short) 0644); // rw-r--r--
 
-  // system directories are world-wide readable and owner readable
-  final static FsPermission SYSTEM_DIR_PERMISSION =
-    FsPermission.createImmutable((short) 0733); // rwx-wx-wx
+  // job submission directory is world readable/writable/executable
+  final static FsPermission JOB_DIR_PERMISSION =
+    FsPermission.createImmutable((short) 0777); // rwx-rwx-rwx
    
   /**
    * Submit a job to the MR system.

+ 6 - 2
src/java/org/apache/hadoop/mapred/JobTracker.java

@@ -89,7 +89,11 @@ public class JobTracker implements MRConstants, InterTrackerProtocol, JobSubmiss
   private ResolutionThread resThread = new ResolutionThread();
   private int numTaskCacheLevels; // the max level to which we cache tasks
   private Set<Node> nodesAtMaxLevel = new HashSet<Node>();
-  
+
+  // system directories are world-wide readable and owner readable
+  final static FsPermission SYSTEM_DIR_PERMISSION =
+    FsPermission.createImmutable((short) 0733); // rwx-wx-wx
+
   /**
    * A client tried to submit a job before the Job Tracker was ready.
    */
@@ -716,7 +720,7 @@ public class JobTracker implements MRConstants, InterTrackerProtocol, JobSubmiss
         // safe mode
         fs.delete(systemDir, true);
         if (FileSystem.mkdirs(fs, systemDir, 
-            new FsPermission(JobClient.SYSTEM_DIR_PERMISSION))) {
+            new FsPermission(SYSTEM_DIR_PERMISSION))) {
           break;
         }
         LOG.error("Mkdirs failed to create " + systemDir);

+ 1 - 1
src/test/org/apache/hadoop/mapred/TestMiniMRWithDFSWithDistinctUsers.java

@@ -70,7 +70,7 @@ public class TestMiniMRWithDFSWithDistinctUsers extends TestCase {
       mkdir(fs, "/mapred");
 
       UnixUserGroupInformation MR_UGI = createUGI(
-          UnixUserGroupInformation.login().getUserName(), true); 
+          UnixUserGroupInformation.login().getUserName(), false); 
       mr = new MiniMRCluster(0, 0, 4, dfs.getFileSystem().getUri().toString(),
            1, null, null, MR_UGI);