ZanderXu commented on PR #4219:
URL: https://github.com/apache/hadoop/pull/4219#issuecomment-1150668804

   Thanks @tomscut , after tracing the code, I think we cannot add 
`elis.isInProgress()`.
   
   And I will explain my ideas trough questions and answers. 
   **Question one: Why was INVALID_TXID considered in the original code?**
   - CheckForGaps method is used to check whether streams contains continuous 
TXids from fromTxId to toAtLeastTxid
   - LastTxId equals INVALID_TXID means the stream is in progress
   - toAtLeastTxid maybe abnormal value, like Long.MaxValue.  So the 
CheckForGaps method only need to cover the latest inprogress segment.
   
   **Question two: What is the difference between INVALID_TXID and is 
InProgress()?**
   - Before introducing [SBN READ], LastTxId equals INVALID_TXID means the 
stream is in progress. And stream is in progress means it's lastTxId is 
INVALID_TXID.
   - But after introducing [SBN READ], LastTxId equals INVALID_TXID means the 
stream is in progress. But stream is in progress cannot mean it's lastTxId is 
INVALID_TXID. Because introducing getJournaledEdits.
   - So if we add `elis.isInProgress()` in CheckForGaps, it cannot cover the 
last writing segments which actual contains latest edit.
   
   Please correct me if anything is wrong.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to