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

Ayush Saxena commented on HDFS-15127:
-------------------------------------

Thanx [~elgoiri] for putting this up, I guess this won't be Order specific, it 
shall be applicable for any entry resolving to multiple locations. 

The solution as we discussed, would be have the similar logic, as we did for 
the {{invokeSequential}} in {{invokeConcurrent}}
Maybe doing something like this  :

{code:java}
     // if (requireResponse && result.hasException()) { // Remove
       // throw result.getException();  Remove these two line
      if (result.hasException()) {
        IOException exception = result.getException();
        if (isUnavailableException(result.getException())) {
          thrownExceptions.add(0, exception);
        } else {
          thrownExceptions.add(result.getException());
        }
{code}
So as to prioritize the {{isUnavailableException}} and then in end we can do :

{code:java}
  if (requireResponse && !thrownExceptions.isEmpty()) {
      throw thrownExceptions.get(0);
    }
    // Throw the first exception if there are no results
    if (ret.isEmpty() && !thrownExceptions.isEmpty()) {
      throw thrownExceptions.get(0);
     }

{code}
 Something like this, may be you can try reusing the previous  code or 
optimizing this.

* You would require to change {{requireResponse}} to true in 
{{getExistingLocation}} as {{getFileInfo}} returns NULL instead FNF.
* The test I feel should get fixed by two changes :

{code:java}
     LOG.info("Check files results for {}: {}", dir0, results);
-    if (faultTolerant || !DestinationOrder.FOLDER_ALL.contains(order)) {
+    if (faultTolerant) {

{code}

and 


{code:java}
-      assertBothResults("check files " + dir0, NUM_FILES, results);
+      assertTrue("Expected some success for " + "check files " + dir0,
+          results.getSuccess() == 0);
     }

{code}

The Jenkins failure is due to some accidental removal of a method, seems some 
copy-paste issue. This much should work for us. :)

> RBF: Do not allow writes when a subcluster is unavailable for HASH_ALL mount 
> points.
> ------------------------------------------------------------------------------------
>
>                 Key: HDFS-15127
>                 URL: https://issues.apache.org/jira/browse/HDFS-15127
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Íñigo Goiri
>            Priority: Major
>         Attachments: HDFS-15127.000.patch
>
>
> A HASH_ALL mount point should not allow creating new files if one subcluster 
> is down.
> If the file already existed in the past, this could lead to inconsistencies.
> We should return an unavailable exception.
> {{TestRouterFaultTolerant#testWriteWithFailedSubcluster()}} needs to be 
> changed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to