NodeIDType
- This task waits for a single replica in a replicated application
to finish executing the request. This is useful when you want only
one replica to execute a request in the common case but ensure
that the committed request is eventually executed despite
failures.
This is essentially a primary backup protocol. But instead of
explicitly designating a primary to execute a request and
propagate it via consensus to everyone (which could require roll
back in the case of primary crashes), we use paxos as usual but
only have one node, say the coordinator (or any designated
replica, e.g., the replica that first received the client
request), actually execute the request and propagate the result to
others. The other replicas normally simply wait for the result,
i.e., the incremental state change, to arrive. If the change does
not arrive within a timeout, they go ahead and execute it anyway.
When used with paxos, each decision now consists of two parts:
decision and result. The replicas store the decision until either
they timeout and decide to execute the decision themselves or the
result arrives.public class WaitPrimaryExecution<NodeIDType> extends WaitAckStopEpoch<NodeIDType>
DB, log, restartCount, startEpoch
waitfor
Constructor and Description |
---|
WaitPrimaryExecution(NodeIDType myID,
StartEpoch<NodeIDType> startEpoch,
RepliconfigurableReconfiguratorDB<NodeIDType> DB,
java.util.Set<NodeIDType> replicas) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
amObviated() |
java.util.Set<ReconfigurationPacket.PacketType> |
getEventTypes() |
java.lang.String |
getKey() |
long |
getPeriod()
The current restart period.
|
java.lang.String |
refreshKey()
Note: Trying to start this task when one is already running will cause
the executor to get stuck.
|
GenericMessagingTask<NodeIDType,?>[] |
restart() |
GenericMessagingTask<NodeIDType,?>[] |
start()
Actions executed in the beginning.
|
getFinalState, handleEvent, handleThresholdEvent, toString
fix, handleEvent, setPeriod
public WaitPrimaryExecution(NodeIDType myID, StartEpoch<NodeIDType> startEpoch, RepliconfigurableReconfiguratorDB<NodeIDType> DB, java.util.Set<NodeIDType> replicas)
myID
- startEpoch
- DB
- replicas
- public GenericMessagingTask<NodeIDType,?>[] start()
ProtocolTask
start
in interface ProtocolTask<NodeIDType,ReconfigurationPacket.PacketType,java.lang.String>
start
in class WaitAckStopEpoch<NodeIDType>
public GenericMessagingTask<NodeIDType,?>[] restart()
restart
in interface SchedulableProtocolTask<NodeIDType,ReconfigurationPacket.PacketType,java.lang.String>
restart
in class WaitAckStopEpoch<NodeIDType>
protected boolean amObviated()
amObviated
in class WaitAckStopEpoch<NodeIDType>
public java.lang.String getKey()
getKey
in interface Keyable<java.lang.String>
getKey
in class WaitAckStopEpoch<NodeIDType>
public java.lang.String refreshKey()
WaitAckStopEpoch
refreshKey
in class WaitAckStopEpoch<NodeIDType>
public java.util.Set<ReconfigurationPacket.PacketType> getEventTypes()
getEventTypes
in interface ProtocolTask<NodeIDType,ReconfigurationPacket.PacketType,java.lang.String>
getEventTypes
in class WaitAckStopEpoch<NodeIDType>
public long getPeriod()
ThresholdProtocolTask
getPeriod
in interface SchedulableProtocolTask<NodeIDType,ReconfigurationPacket.PacketType,java.lang.String>
getPeriod
in class ThresholdProtocolTask<NodeIDType,ReconfigurationPacket.PacketType,java.lang.String>