You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2022/08/17 01:08:17 UTC

[GitHub] [ratis] drriguz commented on pull request #709: RATIS-1642. Specify the thread-safety requirement in StateMachine.

drriguz commented on PR #709:
URL: https://github.com/apache/ratis/pull/709#issuecomment-1217340523

   +1 Change looks good,
   Just one suggestion, may be not related to this issue itself:
   
   Can we clarify what happens when `applyTransaction` failed?  
   See the modifications below(marked with `+`), which is copied from your reply from the mail list: 
   ```
     /**
      * Apply a committed log entry to the state machine. This method is called sequentially in
      * strict serial order that the transactions have been committed in the log. Note that this
      * method, which returns a future, is asynchronous. The state machine implementation may
      * choose to apply the log entries in parallel. In that case, the order of applying entries to
      * state machine could possibly be different from the log commit order.
      *  +
      *  + The implementation should be deterministic so that the log can be replayed in any machine,
      *  + Note that, if there are three or more servers, 
      *  + the Raft algorithm makes sure the log remains consistent even if there are hardware errors 
      *  + in one machine (or less then the majority number of machines).
      *  +
      *  + Any exception thrown in this method will be treated as unrecoverable error(such as hardware error),
      *  + and the server will be force shut down when it occurs. 
      *  + Admin should manually fix the underlying problem and then restart the machine.
   
      * @param trx the transaction state including the log entry that has been committed to a quorum
      *            of the raft peers
      */
     CompletableFuture<Message> applyTransaction(TransactionContext trx);
   ```


-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org