sanpwc commented on a change in pull request #400:
URL: https://github.com/apache/ignite-3/pull/400#discussion_r737711835
##########
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'll be called on every raft node in a group, am I right? If true, do
we really need that in current leader-change-not-supported-during-transaction
approach?
--
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]