[ https://issues.apache.org/jira/browse/HDDS-4059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Glen Geng updated HDDS-4059: ---------------------------- Description: applyTransaction should not call trx.getClientRequest(), since client request will not be replicated from leader to follower. {code:java} SCMStateMachine applyTransaction() final SCMRatisRequest request = SCMRatisRequest.decode( trx.getClientRequest().getMessage());{code} instead, we should call {code:java} SCMStateMachine applyTransaction() final SCMRatisRequest request = SCMRatisRequest.decode( Message.valueOf(trx.getStateMachineLogEntry().getLogData()));{code} since content of client request will be injected to StateMachineEntryProto {code:java} static StateMachineLogEntryProto toStateMachineLogEntryProto( RaftClientRequest request, ByteString logData, ByteString stateMachineData) { if (logData == null) { logData = request.getMessage().getContent(); } return toStateMachineLogEntryProto(request.getClientId(), request.getCallId(), logData, stateMachineData); } {code} was: Due to consistency concern, SCM needs to applyTransaction to RaftLog before it writes to local database and in memory maps. Need refactor the current codes to put this part to Ratis. Ratis will write to DB on behalf of SCM. > SCMStateMachine::applyTransaction() should not invoke > TransactionContext.getClientRequest() > ------------------------------------------------------------------------------------------- > > Key: HDDS-4059 > URL: https://issues.apache.org/jira/browse/HDDS-4059 > Project: Hadoop Distributed Data Store > Issue Type: Sub-task > Components: SCM > Reporter: Glen Geng > Assignee: Glen Geng > Priority: Major > > > applyTransaction should not call trx.getClientRequest(), since client request > will not be replicated from leader to follower. > {code:java} > SCMStateMachine > applyTransaction() > final SCMRatisRequest request = SCMRatisRequest.decode( > trx.getClientRequest().getMessage());{code} > > instead, we should call > {code:java} > SCMStateMachine > applyTransaction() > final SCMRatisRequest request = SCMRatisRequest.decode( > Message.valueOf(trx.getStateMachineLogEntry().getLogData()));{code} > > since content of client request will be injected to StateMachineEntryProto > {code:java} > static StateMachineLogEntryProto toStateMachineLogEntryProto( > RaftClientRequest request, ByteString logData, ByteString > stateMachineData) { > if (logData == null) { > logData = request.getMessage().getContent(); > } > return toStateMachineLogEntryProto(request.getClientId(), > request.getCallId(), logData, stateMachineData); > } > {code} > > -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org