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

hunshenshi commented on HDFS-14361:
-----------------------------------

[~brahmareddy]

 
{code:java}
for (; i < uploads.size(); i++) {
  Future<TransferFsImage.TransferResult> upload = uploads.get(i);
  try {
    // TODO should there be some smarts here about retries nodes that are not 
the active NN?
    if (upload.get() == TransferFsImage.TransferResult.SUCCESS) {
      success = true;
      //avoid getting the rest of the results - we don't care since we had a 
successful upload
      break;
    }

  } catch (ExecutionException e) {
    ioe = new IOException("Exception during image upload", e);
    break;
  } catch (InterruptedException e) {
    ie = e;
    break;
  }
}
if (ie == null && ioe == null) {
  //Update only when response from remote about success or
  lastUploadTime = monotonicNow();
  // we are primary if we successfully updated the ANN
  this.isPrimaryCheckPointer = success;
}
{code}
 

If `upload.get`occure error,  the code `this.isPrimaryCheckPointer = success` 
can't be executed.

> SNN will always upload fsimage
> ------------------------------
>
>                 Key: HDFS-14361
>                 URL: https://issues.apache.org/jira/browse/HDFS-14361
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: ha, namenode
>    Affects Versions: 3.2.0
>            Reporter: hunshenshi
>            Priority: Major
>             Fix For: 3.2.0
>
>
> Related to -HDFS-12248.-
> {code:java}
> boolean sendRequest = isPrimaryCheckPointer
>     || secsSinceLastUpload >= checkpointConf.getQuietPeriod();
> doCheckpoint(sendRequest);
> {code}
> If sendRequest is true, SNN will upload fsimage. But isPrimaryCheckPointer 
> always is true,
> {code:java}
> if (ie == null && ioe == null) {
>   //Update only when response from remote about success or
>   lastUploadTime = monotonicNow();
>   // we are primary if we successfully updated the ANN
>   this.isPrimaryCheckPointer = success;
> }
> {code}
> isPrimaryCheckPointer should be outside the if condition.
> If the ANN update was not successful, then isPrimaryCheckPointer should be 
> set to false.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to