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

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

steveloughran commented on code in PR #4758:
URL: https://github.com/apache/hadoop/pull/4758#discussion_r954766717


##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/commit/ITestAbfsRenameStageFailure.java:
##########
@@ -59,7 +66,10 @@ protected AbstractFSContract createContract(final 
Configuration conf) {
 
   @Override
   protected boolean requireRenameResilience() {
-    return true;
+    if (isNamespaceEnabled()) {

Review Comment:
   can be simplified to 
   ```
   return isNamespaceEnabled();
   ```
   



##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/commit/ITestAbfsRenameStageFailure.java:
##########
@@ -41,6 +42,12 @@ public ITestAbfsRenameStageFailure() throws Exception {
     binding = new ABFSContractTestBinding();
   }
 
+  protected boolean isNamespaceEnabled() {
+    FileSystem fs = getFileSystem();
+    String namespaceEnabled = 
fs.getConf().get("fs.azure.test.namespace.enabled");

Review Comment:
   there's a Configuration.getBoolean(key, defval) which should be used for 
evaluating true/false. it knows about trimming strings, case independence etc. 
have a look at the class and see what else it can do. using the basic get() 
without a default is generally a rare action.
   
   better.
   
   ```
   return conf.getBoolean("fs.azure.test.namespace.enabled", false)
   ```
   
   2. other tests, specificlly everything under `AbstractAbfsIntegrationTest`, 
probe the fs for having ACLs and use that to dynamically determine fs 
capabilities. see `getIsNamespaceEnabled()` for how it is done.
   
   i would prefer you copy the AbstractAbfsIntegrationTest algorithm as it is 
based on the actual FS capabilities
   





> [ABFS]: Set correct value of requireRenameResilience for NonHNS-SharedKey 
> configuration
> ---------------------------------------------------------------------------------------
>
>                 Key: HADOOP-18408
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18408
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs/azure, test
>            Reporter: Pranav Saxena
>            Assignee: Sree Bhattacharyya
>            Priority: Minor
>              Labels: pull-request-available
>
> ITestAbfsRenameStageFailure fails for NonHNS-SharedKey configuration.
> Failure:
> [ERROR] 
> ITestAbfsRenameStageFailure>TestRenameStageFailure.testResilienceAsExpected:126
>  [resilient commit support] expected:<[tru]e> but was:<[fals]e>
> RCA:
> ResilientCommit looks for whether etags are preserved in rename, if not then 
> it throws an exception and the flag for resilientCommitByRename stays null, 
> leading ultimately to the test failure
> Mitigation:
> Since, etags are not preserved in the case of rename in nonHNS account, 
> required value for rename resilience should be False, as resilient commits 
> cannot be made. Thus, requiring a True value for requireRenameResilience for 
> nonHNS account is not a valid case. Hence, as part of this task, we shall set 
> correct value of False for requireRenameResilience for nonHNS account.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to