HADOOP-19208: [Backport to 3.4][ABFS] Fixing logic to determine HNS nature of account to avoid extra getAcl() calls #6946
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira: https://issues.apache.org/jira/browse/HADOOP-19208
PR merged to trunk: #6893
Original Description of PR
ABFS driver needs to know the type of account being used. It relies on the user to inform the account type using the config
fs.azure.account.hns.enabled
. If not configured, driver makes a GetAcl Head Call call to determine the account type.Expectation is getAcl() will fail with 400 Bad Request if made on the FNS Account.
If succeeded or fails with any other error code, it means it's an HNS Account.
Current Implementation:
Today when someone tries to create a new file system, getAcl is called to determine HNS/FNS account. This call fails with 404 as file system is not yet created. Then another getAcl is needed to determine HNS/FNS post filesystem creation. Leading to redundant getAcl calls.
New Implementation
This PR also fixes a test case failing on trunk.
testGetAclCallOnHnsConfigAbsence(org.apache.hadoop.fs.azurebfs.ITestAzureBlobFileSystemInitAndCreate)
How was this patch tested?
New test around the production code changes, and existing test suite ran to validate the patch.
Test Suite Results
Metric related tests are fixed in the the #6847