[ 
https://issues.apache.org/jira/browse/HADOOP-19208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17864905#comment-17864905
 ] 

ASF GitHub Bot commented on HADOOP-19208:
-----------------------------------------

anujmodi2021 commented on code in PR #6893:
URL: https://github.com/apache/hadoop/pull/6893#discussion_r1673391895


##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java:
##########
@@ -395,14 +395,18 @@ private synchronized boolean 
getNamespaceEnabledInformationFromServer(
     try {
       LOG.debug("Get root ACL status");
       getClient().getAclStatus(AbfsHttpConstants.ROOT_PATH, tracingContext);
+      // If getAcl succeeds, namespace is enabled.
       isNamespaceEnabled = Trilean.getTrilean(true);
     } catch (AbfsRestOperationException ex) {
-      // Get ACL status is a HEAD request, its response doesn't contain
-      // errorCode
-      // So can only rely on its status code to determine its account type.
+      // Get ACL status is a HEAD request, its response doesn't contain 
errorCode
+      // So can only rely on its status code to determine account type.
       if (HttpURLConnection.HTTP_BAD_REQUEST != ex.getStatusCode()) {
+        // If getAcl fails with anything other than 400, namespace is enabled.
+        isNamespaceEnabled = Trilean.getTrilean(true);

Review Comment:
   Added debug logs





> ABFS: Fixing logic to determine HNS nature of account to avoid extra getAcl() 
> calls
> -----------------------------------------------------------------------------------
>
>                 Key: HADOOP-19208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19208
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/azure
>    Affects Versions: 3.4.0
>            Reporter: Anuj Modi
>            Assignee: Anuj Modi
>            Priority: Major
>              Labels: pull-request-available
>
> 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 call to determine the account type.
> Expectation is getAcl() will fail with 400 Bad Request if made on the FNS 
> Account.
> For any other case including 200, 404 it will indicate account is HNS.
> Today, when determining this, the logic only checks status code to be either 
> 200 or 400. In case of 404, nothing is inferred, and this leads to more 
> getAcl again and again until 200 or 400 comes.
> Fix is to update the logic such that if getAcl() fails with 400, it is FNS 
> account. For all other cases it will be an HNS account. In case of 
> throttling, if all retries are exhausted, FS init itself will fail.
> This is also to fix a test case failing on trunk. 
> {{testGetAclCallOnHnsConfigAbsence(org.apache.hadoop.fs.azurebfs.ITestAzureBlobFileSystemInitAndCreate)}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to