szetszwo commented on a change in pull request #2163:
URL: https://github.com/apache/hadoop/pull/2163#discussion_r458954041
##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml
##########
@@ -5119,7 +5119,6 @@
for storing directory snapshot diffs. By default, value is set to 10.
</description>
</property>
-
Review comment:
We should leave hdfs-default.xml untouched since we are not changing
anything.
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/common/HdfsServerConstants.java
##########
@@ -366,6 +366,7 @@ public void write(DataOutput out) throws IOException {
"security.hdfs.unreadable.by.superuser";
String XATTR_ERASURECODING_POLICY =
"system.hdfs.erasurecoding.policy";
+ String SNAPSHOT_XATTR_NAME = "system.hdfs.snapshot";
Review comment:
The xattr name should contain "deleted". How about
"system.hdfs.snapshot.deleted"?
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirXAttrOp.java
##########
@@ -326,6 +327,12 @@ static INode unprotectedSetXAttrs(
throw new IOException("Can only set '" +
SECURITY_XATTR_UNREADABLE_BY_SUPERUSER + "' on a file.");
}
+
+ if (xaName.equals(SNAPSHOT_XATTR_NAME) && !(inode.isDirectory() &&
Review comment:
Let's check "!(inode instanceof of Snapshot.Root)" instead of
"!(inode.isDirectory() && inode.getParent().isSnapshottable())?
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]