-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-22578 HFileCleaner should not delete empty ns/table directories… #337
Conversation
💔 -1 overall
This message was automatically generated. |
* acls are set at these directories; the archive data directory should not be deleted because | ||
* the HDFS acls of global permission is set at this directory. | ||
*/ | ||
/*if (userScanSnapshotEnabled) { |
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 if condition shouldn't be commented. Without it, the added test case "testCleanArchiveTableDir" fails.
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.
Yes, sorry for my carelessness, will fix it.
fc69c10
to
cd08e01
Compare
🎊 +1 overall
This message was automatically generated. |
cd08e01
to
c93a21d
Compare
💔 -1 overall
This message was automatically generated. |
* @param dir The path of a directory | ||
* @return True if the directory can be deleted, otherwise false | ||
*/ | ||
boolean shouldDeleteDirectory(Path dir) { |
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.
isDirDeletable ?
* @param dir Path of the directory | ||
* @return True if the directory can be deleted, otherwise false | ||
*/ | ||
private boolean canDeleteEmptyDirectory(Path dir) { |
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.
canDeleteEmptyDirectory -> isEmptyDirDeletable ?
|
||
private boolean isUserScanSnapshotEnabled(Configuration conf) { | ||
String masterCoprocessors = conf.get(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY); | ||
if (conf.getBoolean(SnapshotScannerHDFSAclHelper.USER_SCAN_SNAPSHOT_ENABLE, false) |
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.
Reconsider the USER_SCAN_SNAPSHOT_ENABLE name, seems not a good name, because even if we don't enable the feature, user can still scan the snapshot ? so better to use SYNC_TABLE_ACL_IN_HDFS or some other config keys to express the point is to sync the table granted acl to HDFS acl, it will help to understand this.
BTW, a deprecated config keys is a trouble, so better to give a suitable name in the first definition.
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.
Yes, great suggestions, I think there are some configs should be renamed to a more proper name, I will do this work in another issus.
return false; | ||
} | ||
} catch (IOException e) { | ||
LOG.warn("Check if namespace {} exists error", namespace, e); |
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.
Just throw the exception ? and handle in the outside (CleanerChore#canDeleteEmptyDirectory )
} | ||
|
||
@Override | ||
public boolean canDeleteEmptyDirectory(Path dir) { |
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.
isEmptyDirDeletable ? or isDirDeletable ?
|
||
@VisibleForTesting | ||
static boolean isArchiveNamespaceDir(Path path) { | ||
return path == null ? false : isArchiveDataDir(path.getParent()); |
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.
return path != null && isArchiveDataDir(path.getParent()) ?
|
||
@VisibleForTesting | ||
static boolean isArchiveTableDir(Path path) { | ||
return path == null ? false : isArchiveNamespaceDir(path.getParent()); |
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.
ditto
2e0e1b0
to
50aac57
Compare
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
… used for user san snapshot feature
50aac57
to
a00149d
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
… used for user san snapshot feature (#337)
… used for user san snapshot feature (apache#337)
… used for user san snapshot feature