ascherbakoff commented on a change in pull request #400:
URL: https://github.com/apache/ignite-3/pull/400#discussion_r749045342
##########
File path:
modules/raft/src/main/java/org/apache/ignite/raft/jraft/rpc/impl/ActionRequestProcessor.java
##########
@@ -66,67 +68,112 @@ public ActionRequestProcessor(Executor executor,
RaftMessagesFactory factory) {
return;
}
- if (request.command() instanceof WriteCommand) {
- node.apply(new
Task(ByteBuffer.wrap(JDKMarshaller.DEFAULT.marshall(request.command())),
- new CommandClosureImpl<>(request.command()) {
- @Override public void result(Serializable res) {
-
rpcCtx.sendResponse(factory.actionResponse().result(res).build());
- }
+ JRaftServerImpl.DelegatingStateMachine fsm =
(JRaftServerImpl.DelegatingStateMachine) node.getOptions().getFsm();
- @Override public void run(Status status) {
- assert !status.isOk() : status;
+ // Apply a filter before commiting to STM.
+ CompletableFuture<Void> fut =
fsm.getListener().onBeforeApply(request.command());
Review comment:
It's called only on the leader.
--
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]