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

   @xkrogen Thanks for your review and comment. Sorry for the late replay.
   
   Before `catchupDuringFailover`,  whatever active crash or successfully 
changed to standby, the last segment in majority journalnode should be 
finalized.  My idea is `catchupDuringFailover` just ignore 
`selectRpcInputStreams` and fail back to use `selectStreamingInputStreams` with 
`getEditLogManifest`.  
   
   Unfortunately,  `catchupDuringFailover` can only use disable in-progress to 
ignore `selectRpcInputStreams`, because `inProgressTailingEnabled` in 
`QuorumJournalManager` is unchangeable.
   The key code is as follows:
   ```
     @Override
     public void selectInputStreams(Collection<EditLogInputStream> streams,
         long fromTxnId, boolean inProgressOk,
         boolean onlyDurableTxns) throws IOException {
    
       // Here, catchupDuringFailover should ignore this if branch and fail 
back to selectStreamingInputStreams
   
       if (inProgressOk && inProgressTailingEnabled) {
         LOG.debug("Tailing edits starting from txn ID {} via RPC mechanism", 
fromTxnId);
         try {
           Collection<EditLogInputStream> rpcStreams = new ArrayList<>();
           selectRpcInputStreams(rpcStreams, fromTxnId, onlyDurableTxns);
           streams.addAll(rpcStreams);
           return;
         } catch (IOException ioe) {
           LOG.warn("Encountered exception while tailing edits >= " + fromTxnId 
+
               " via RPC; falling back to streaming.", ioe);
         }
       }
       selectStreamingInputStreams(streams, fromTxnId, inProgressOk,
           onlyDurableTxns);
     }
   ``` 


-- 
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