Skip to content

Conversation

@lokeshj1703
Copy link
Contributor

What changes were proposed in this pull request?

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.

      future.thenApply(r -> {
        if (trx.getServerRole() == RaftPeerRole.LEADER) {
          long startTime = (long) trx.getStateMachineContext();
          metrics.incPipelineLatency(cmdType,
              Time.monotonicNowNanos() - startTime);
        }

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.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-4580

How was this patch tested?

Existing UT

@lokeshj1703 lokeshj1703 self-assigned this Dec 11, 2020
Copy link
Contributor

@xiaoyuyao xiaoyuyao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, +1.

@xiaoyuyao xiaoyuyao merged commit 81b75fd into apache:master Dec 14, 2020
jojochuang pushed a commit to jojochuang/ozone that referenced this pull request Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants