Skip to content
Permalink
Browse files

Delete stepped down Raft node on Raft query

  • Loading branch information...
metanet committed Feb 12, 2019
1 parent b018ac1 commit e7a869b6209b0e8529a5e85c3263d3287997c93b
Showing with 14 additions and 9 deletions.
  1. +14 −9 hazelcast/src/main/java/com/hazelcast/cp/internal/operation/RaftQueryOp.java
@@ -18,20 +18,21 @@

import com.hazelcast.core.ExecutionCallback;
import com.hazelcast.core.ICompletableFuture;
import com.hazelcast.cp.internal.RaftNodeAware;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.IdentifiedDataSerializable;
import com.hazelcast.cp.internal.raft.QueryPolicy;
import com.hazelcast.cp.CPGroupId;
import com.hazelcast.cp.exception.NotLeaderException;
import com.hazelcast.cp.exception.CPGroupDestroyedException;
import com.hazelcast.cp.internal.raft.impl.RaftNode;
import com.hazelcast.cp.internal.RaftOp;
import com.hazelcast.cp.internal.RaftSystemOperation;
import com.hazelcast.cp.exception.NotLeaderException;
import com.hazelcast.cp.internal.IndeterminateOperationStateAware;
import com.hazelcast.cp.internal.RaftNodeAware;
import com.hazelcast.cp.internal.RaftOp;
import com.hazelcast.cp.internal.RaftService;
import com.hazelcast.cp.internal.RaftServiceDataSerializerHook;
import com.hazelcast.cp.internal.RaftSystemOperation;
import com.hazelcast.cp.internal.raft.QueryPolicy;
import com.hazelcast.cp.internal.raft.impl.RaftNode;
import com.hazelcast.cp.internal.raft.impl.RaftNodeStatus;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.IdentifiedDataSerializable;
import com.hazelcast.spi.Operation;

import java.io.IOException;
@@ -72,6 +73,10 @@ public final void run() {
sendResponse(new NotLeaderException(groupId, service.getLocalCPMember(), null));
}
return;
} else if (raftNode.getStatus() == RaftNodeStatus.STEPPED_DOWN) {
service.stepDownRaftNode(groupId);
sendResponse(new NotLeaderException(groupId, service.getLocalCPMember(), null));
return;
}

if (op instanceof RaftNodeAware) {

0 comments on commit e7a869b

Please sign in to comment.
You can’t perform that action at this time.