[ https://issues.apache.org/jira/browse/RATIS-2094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Duong updated RATIS-2094: ------------------------- Description: stateMachineLogEntry and stateMachineContext are parsed/created from RaftClientRequest or LogEntryProto and attached to TransactionContext in the StateMachine.startTransaction methods. There are 2 variant of StateMachine.startTransaction; 1. startTransactions(RaftClientRequest): This is called only on the leader side. The result of this method is not cached and is passed temporarily alongside RaftClientRequest for further processing, for example. This is probably safe. 2. startTransactions(LogEntryProto, RaftPeerRole): this is called on both leader and follower side. The result of this call is cached on the node * On leader: this is called right before applyTransaction to produce a TransactionContext for StateMachine.applyTransaction. * On follower: this is called when the appendEntries request is received. The result is cached to be used by StateMachine.write and then StateMachine.applyTransaction. was: stateMachineLogEntry and stateMachineContext are parsed/created from RaftClientRequest or LogEntryProto and attached to TransactionContext in the StateMachine.startTransaction methods. There are 2 variant of StateMachine.startTransactions; 1. startTransactions(RaftClientRequest): This is called only on the leader side. The result of this method is not cached and is passed temporarily alongside RaftClientRequest for further processing, for example. This is probably safe. 2. startTransactions(LogEntryProto, RaftPeerRole): this is called on both server and leader side. The result of this call is cached on the node. - On server side > TransactionContext's stateMachineLogEntry and stateMachineContext may cause > corruption > -------------------------------------------------------------------------------------- > > Key: RATIS-2094 > URL: https://issues.apache.org/jira/browse/RATIS-2094 > Project: Ratis > Issue Type: Sub-task > Reporter: Duong > Assignee: Duong > Priority: Major > > stateMachineLogEntry and stateMachineContext are parsed/created from > RaftClientRequest or LogEntryProto and attached to TransactionContext in the > StateMachine.startTransaction methods. > There are 2 variant of StateMachine.startTransaction; > 1. startTransactions(RaftClientRequest): This is called only on the leader > side. The result of this method is not cached and is passed temporarily > alongside RaftClientRequest for further processing, for example. This is > probably safe. > 2. startTransactions(LogEntryProto, RaftPeerRole): this is called on both > leader and follower side. The result of this call is cached on the node > * On leader: this is called right before applyTransaction to produce a > TransactionContext for StateMachine.applyTransaction. > * On follower: this is called when the appendEntries request is received. > The result is cached to be used by StateMachine.write and then > StateMachine.applyTransaction. > > -- This message was sent by Atlassian Jira (v8.20.10#820010)