You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Xiaoyu Yao (Jira)" <ji...@apache.org> on 2020/12/14 21:51:00 UTC

[jira] [Resolved] (HDDS-4580) Datanode can be stuck in leader not ready state after restart

     [ https://issues.apache.org/jira/browse/HDDS-4580?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xiaoyu Yao resolved HDDS-4580.
------------------------------
    Fix Version/s: 1.1.0
       Resolution: Fixed

Thanks [~ljain] for the contribution. PR has been merged. 

> Datanode can be stuck in leader not ready state after restart
> -------------------------------------------------------------
>
>                 Key: HDDS-4580
>                 URL: https://issues.apache.org/jira/browse/HDDS-4580
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>          Components: Ozone Datanode
>            Reporter: Lokesh Jain
>            Assignee: Lokesh Jain
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.1.0
>
>
> On restart the transactions are reapplied for an existing ratis pipeline. ContainerStateMachine#applyTransaction while processing future can throw NullPointerException leading to the future being completed exceptionally. 
> {code:java}
>       future.thenApply(r -> {
>         if (trx.getServerRole() == RaftPeerRole.LEADER) {
>           long startTime = (long) trx.getStateMachineContext();
>           metrics.incPipelineLatency(cmdType,
>               Time.monotonicNowNanos() - startTime);
>         }
> {code}
> In the above code snippet trx.getStateMachineContext() will be null during restart and this fails the future itself without updating the applyTransactionCompletionMap. As a result the lastAppliedIndex is not updated for the server and server is stuck in leader not ready state.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org