New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TEZ-4412 ensure mkDirForAM create directory with special permissions #209
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Hi @abstractdog ,I found some permission issue here, can you please take a look? |
thanks for the patch @skysiders! |
fs.mkdirs(dir, new FsPermission(TEZ_AM_DIR_PERMISSION)); | ||
FsPermission perm = new FsPermission(TEZ_AM_DIR_PERMISSION); | ||
fs.mkdirs(dir, perm); | ||
if(!fs.getFileStatus(dir).getPermission().equals(perm)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method is public static, looks easily testable, could you please introduce a unit test in TestTezCommonUtils?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review. I will check it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @abstractdog ,I add UT and fix check style. Couldyou please take a look?
This comment was marked as outdated.
This comment was marked as outdated.
Hi @abstractdog , I'm sorry to make mistake in UT, and I try to fix it in this patch. |
🎊 +1 overall
This message was automatically generated. |
thanks @skysiders , there is 1 more checkstyle issue reported |
Thanks for your review @abstractdog , I use checkstyle:check find issue in |
🎊 +1 overall
This message was automatically generated. |
Configuration remoteConf = new Configuration(); | ||
remoteConf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, TEST_ROOT_DIR); | ||
remoteConf.set(CommonConfigurationKeys.FS_PERMISSIONS_UMASK_KEY, "777"); | ||
MiniDFSCluster miniDFS = new MiniDFSCluster.Builder(remoteConf).numDataNodes(3).format(true).racks(null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unit test works as expected, this patch is so close, 1 more thing, could you please shutdown miniDFS cluster?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @abstractdog .Thanks for your suggestion, In this patch, I closed miniDFS after I ran out of it. Thank you for reviewing my code, it has taught me a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merged to master, thanks @skysiders for this patch, your tireless work, and quick responses!
🎊 +1 overall
This message was automatically generated. |
…209) (Zhang Dongsheng reviewed by Laszlo Bodor)
TEZ-4412 ensure mkDirForAM create directory with special permissions
I found TezClientUtils has method ensureStagingDirExists.It will check whether the path "stagingArea" exists, if it exists, check the permission, if not, call the function "TezCommonUtils.mkDirForAM" to create.But in method mkDirForAM,it use mkdir(path, permission) to create, if umask too strict such as 777,this directory will set with 000 permission.So we need to ensure the directory has right permission.
In this patch, I compared the permissions of the files with the expected permissions. If they are inconsistent, then log this and use setPermission to grant directory permissions.