-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HDFS-15480. Ordered snapshot deletion: record snapshot deletion in XAttr #2163
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
Changes from 4 commits
cba7c00
f7dfa8d
4f2efde
e43dbc0
918026c
7613161
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,10 +41,11 @@ | |
| import java.util.List; | ||
| import java.util.ListIterator; | ||
|
|
||
| import static org.apache.hadoop.hdfs.server.common.HdfsServerConstants.CRYPTO_XATTR_ENCRYPTION_ZONE; | ||
| import static org.apache.hadoop.hdfs.server.common.HdfsServerConstants.SECURITY_XATTR_UNREADABLE_BY_SUPERUSER; | ||
| import static org.apache.hadoop.hdfs.server.common.HdfsServerConstants.XATTR_SATISFY_STORAGE_POLICY; | ||
| import static org.apache.hadoop.hdfs.server.common.HdfsServerConstants.CRYPTO_XATTR_FILE_ENCRYPTION_INFO; | ||
| import static org.apache.hadoop.hdfs.server.common.HdfsServerConstants.SNAPSHOT_XATTR_NAME; | ||
| import static org.apache.hadoop.hdfs.server.common.HdfsServerConstants.CRYPTO_XATTR_ENCRYPTION_ZONE; | ||
|
|
||
| class FSDirXAttrOp { | ||
| private static final XAttr KEYID_XATTR = | ||
|
|
@@ -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() && | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's check "!(inode instanceof of Snapshot.Root)" instead of "!(inode.isDirectory() && inode.getParent().isSnapshottable())? |
||
| inode.getParent().isSnapshottable())) { | ||
| throw new IOException("Can only set '" + | ||
| SNAPSHOT_XATTR_NAME + "' on a snapshot root."); | ||
| } | ||
| } | ||
|
|
||
| XAttrStorage.updateINodeXAttrs(inode, newXAttrs, iip.getLatestSnapshotId()); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5119,7 +5119,6 @@ | |
| for storing directory snapshot diffs. By default, value is set to 10. | ||
| </description> | ||
| </property> | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should leave hdfs-default.xml untouched since we are not changing anything. |
||
| <property> | ||
| <name>dfs.storage.policy.satisfier.enabled</name> | ||
| <value>false</value> | ||
|
|
||
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.
The xattr name should contain "deleted". How about "system.hdfs.snapshot.deleted"?