-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
HADOOP-19089: [ABFS] Reverting Back Support of setXAttr() and getXAttr() on root path #6592
HADOOP-19089: [ABFS] Reverting Back Support of setXAttr() and getXAttr() on root path #6592
Conversation
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.
LGTM! Some minor comments on test.
public void testGetSetXAttrOnRoot() throws Exception { | ||
AzureBlobFileSystem fs = getFileSystem(); | ||
final Path testPath = new Path("/"); | ||
testGetSetXAttrHelper(fs, testPath); |
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.
To prevent revert add of getFileSystemProperties and setFileSystemProperties for getXAttr / setXAttr in future, should we not remove this method, and additionally assert that the getFileSystemProperties and setFileSystemProperties of store are not called, but setPathProperties and getPathStatus of store is called..
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.
Lets add an assert that this should throw 4xx error.
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.
Reason for this comment:
- Lets say getFsProperties / setFSProperties are added again in future. This test will raise an CI issue on that patch.
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.
Makes sense.
Added back the negative test.
## <a name="KnownIssues"></a> Known Issues | ||
|
||
Following failures are known and expected to fail as of now. | ||
1. AzureBlobFileSystem.setXAttr() and AzureBlobFileSystem.getXAttr() will fail when attempted on root ("/") path. |
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.
Lets add reason for the failure as well
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.
Taken
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
try { | ||
fs.getXAttr(testPath, attributeName); | ||
} catch (AbfsRestOperationException e) { | ||
Assertions.assertThat(e.getStatusCode()).isEqualTo(HTTP_BAD_REQUEST); |
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.
Assert will happen only if exception is thrown. We should make sure that exception does happen.. Lets use LambdaTestUtils.intercept
. Similarly for the other setXAttr intercept
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.
LGTM!
🎊 +1 overall
This message was automatically generated. |
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.
LGTM
+1
…r() on root path (#6592) This reverts most of HADOOP-18869: [ABFS] Fix behavior of a File System APIs on root path (#6003). Calling getXAttr("/") or setXAttr("/") on an abfs container will fail with `Operation failed: "The request URI is invalid.", HTTP 400 Bad Request` This change is to ensure: * Consistency across ADLS clients * Consistency across authentication mechanisms. Contributed by Anuj Modi
merged to trunk, cherrypicked to branch 3.4, reran modified test. if you want branch-3.3.x support, do a test run yourself and push up a new pr |
Description of PR
Jira: https://issues.apache.org/jira/browse/HADOOP-19089
A while back changes were made to support HDFS.setXAttr() and HDFS.getXAttr() on root path for ABFS Driver.
For these, filesystem level APIs were introduced and used to set/get metadata of container.
Refer to Jira: https://issues.apache.org/jira/browse/HADOOP-18869
Ideally, same set of APIs should be used, and root should be treated as a path like any other path.
This change is to avoid calling container APIs for these HDFS calls.
As a result of this these APIs will fail on root path (as earlier) because service does not support get/set of user properties on root path.
This change will also update the documentation to reflect that these operations are not supported on root path.
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?