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

Sumit Agrawal updated HDDS-9960:
--------------------------------
    Description: 
update lastTransactionIndex is also done from another flow,

ratis --> notifyTermIndexUpdated(). --> computeAndUpdateLastAppliedIndex() -->  
else part (for flow from ratis)
{code:java}
} else {
  if (getLastAppliedTermIndex().getIndex() + 1 == lastFlushedIndex) {
    updateLastAppliedTermIndex(currentTerm, lastFlushedIndex);
    if (LOG.isDebugEnabled()) {
      LOG.debug("ComputeAndUpdateLastAppliedIndex due to notifyIndex {}",
          getLastAppliedTermIndex());
    }
  } else {
    ratisTransactionMap.put(lastFlushedIndex, currentTerm); {code}
If lastTransactionAppliedIndex and ratis transaction index difference is only 
"1", it update the last transaction index. This can cause db flush transaction 
to be behind the ratis transaction. So replay of those tranasaction will not 
happen in case of OM crash at this point.

 

So there is a two different behavior exist, that when to update 
lastAppliedTransaction, creating confusion about expectation for this 
perspective.

 

Also its observed updating last applied transaction stuck when there is 
difference in transaction index due to exception. This was causing 
ratisTransactionMap holding large number of transaction and not applied. 
https://issues.apache.org/jira/browse/HDDS-9342.

 

> OM State machine lastIndexUpdate incorrect and complex
> ------------------------------------------------------
>
>                 Key: HDDS-9960
>                 URL: https://issues.apache.org/jira/browse/HDDS-9960
>             Project: Apache Ozone
>          Issue Type: Bug
>            Reporter: Sumit Agrawal
>            Assignee: Sumit Agrawal
>            Priority: Major
>
> update lastTransactionIndex is also done from another flow,
> ratis --> notifyTermIndexUpdated(). --> computeAndUpdateLastAppliedIndex() 
> -->  else part (for flow from ratis)
> {code:java}
> } else {
>   if (getLastAppliedTermIndex().getIndex() + 1 == lastFlushedIndex) {
>     updateLastAppliedTermIndex(currentTerm, lastFlushedIndex);
>     if (LOG.isDebugEnabled()) {
>       LOG.debug("ComputeAndUpdateLastAppliedIndex due to notifyIndex {}",
>           getLastAppliedTermIndex());
>     }
>   } else {
>     ratisTransactionMap.put(lastFlushedIndex, currentTerm); {code}
> If lastTransactionAppliedIndex and ratis transaction index difference is only 
> "1", it update the last transaction index. This can cause db flush 
> transaction to be behind the ratis transaction. So replay of those 
> tranasaction will not happen in case of OM crash at this point.
>  
> So there is a two different behavior exist, that when to update 
> lastAppliedTransaction, creating confusion about expectation for this 
> perspective.
>  
> Also its observed updating last applied transaction stuck when there is 
> difference in transaction index due to exception. This was causing 
> ratisTransactionMap holding large number of transaction and not applied. 
> https://issues.apache.org/jira/browse/HDDS-9342.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to