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

hunshenshi edited comment on HDFS-14361 at 3/15/19 6:11 AM:
------------------------------------------------------------

[~starphin] , _sendCheckpoint_ _will be set false if another SNN send 
checkpoint request to ANN successfully. But I didn't find where sendCheckpoint 
is set to false._

_The isPrimaryCheckPointer inside `if` block, to be set true. T*he 
isPrimaryCheckPointer not set to false anywhere.*_

So this code `sendRequest`
{code:java}
boolean sendRequest = isPrimaryCheckPointer
    || secsSinceLastUpload >= checkpointConf.getQuietPeriod();{code}
will be true, _sendCheckpoint_ _will *be still set true* if another SNN send 
checkpoint request to ANN successfully._
 _If the isPrimaryCheckPointer outside `if` block, isPrimaryCheckPointer will 
be set to the value of the variable `success_`(true of false)


was (Author: hunhun):
[~starphin] , _sendCheckpoint_ _will be set false if another SNN send 
checkpoint request to ANN successfully. But I didn't find where sendCheckpoint 
is set to false._

_The isPrimaryCheckPointer inside `if` block, to be set true. T*he 
isPrimaryCheckPointer not set to false anywhere.*_

So this code `sendRequest`
{code:java}
boolean sendRequest = isPrimaryCheckPointer
    || secsSinceLastUpload >= checkpointConf.getQuietPeriod();{code}
will be true, _sendCheckpoint_ _will *be still set true* if another SNN send 
checkpoint request to ANN successfully._
_If the isPrimaryCheckPointer outside `if` block, isPrimaryCheckPointer will be 
set to the value of the variable `_success_`(true of false)_

> 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