Documentation ¶
Overview ¶
Package dynamic is a generated protocol buffer package.
It is generated from these files:
dynamicpaxos.proto
It has these top-level messages:
Command Timestamp PaxosProposeReq PaxosProposeReply FpProposeReq FpProposeReply ProbeReq ProbeReply ProbeTimeReply ReplicaProbeReply ReplicaMsg EmptyReply TestReq TestReply
Index ¶
- Constants
- func CompareTime(t1, t2 *Timestamp) int
- func RegisterDynamicPaxosServer(s *grpc.Server, srv DynamicPaxosServer)
- type Client
- type ClientFastIo
- func (fIo *ClientFastIo) BcstFpProposeToFollowers(addrList []string, req *FpProposeReq, fastC chan<- *FpProposeReply, ...)
- func (fIo *ClientFastIo) InitConn(addrList []string)
- func (io *ClientFastIo) SendFpProposeToExecReplica(addr string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, ...)
- func (fIo *ClientFastIo) SendFpProposeToLeader(leader string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, ...)
- func (fIo *ClientFastIo) SendPaxosProposeReq(addr string, cmd *Command) *PaxosProposeReply
- func (fIo *ClientFastIo) SendProbeReq(addr string) *ProbeReply
- func (fIo *ClientFastIo) SendProbeTimeReq(addr string) *ProbeTimeReply
- func (fIo *ClientFastIo) SendTestReq(addr string)
- type ClientGrpc
- func (gIo *ClientGrpc) BcstFpProposeToFollowers(addrList []string, req *FpProposeReq, fastC chan<- *FpProposeReply, ...)
- func (gIo *ClientGrpc) InitConn(addrList []string)
- func (gIo *ClientGrpc) SendFpProposeToExecReplica(addr string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, ...)
- func (gIo *ClientGrpc) SendFpProposeToLeader(leaderAddr string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, ...)
- func (gIo *ClientGrpc) SendPaxosProposeReq(addr string, cmd *Command) *PaxosProposeReply
- func (gIo *ClientGrpc) SendProbeReq(addr string) *ProbeReply
- func (gIo *ClientGrpc) SendProbeTimeReq(addr string) *ProbeTimeReply
- func (gIo *ClientGrpc) SendTestReq(addr string)
- type ClientIo
- type CmdEntry
- type CommManager
- func (cm *CommManager) BuildConnection(addr string) *grpc.ClientConn
- func (cm *CommManager) BuildRpcStub(addr string) DynamicPaxosClient
- func (cm *CommManager) GetConnection(addr string) (*grpc.ClientConn, bool)
- func (cm *CommManager) GetRpcStub(addr string) (DynamicPaxosClient, bool)
- func (cm *CommManager) NewRpcStub(addr string) DynamicPaxosClient
- type Command
- type DynamicClient
- func (c *DynamicClient) Close()
- func (c *DynamicClient) ExecFastPaxosPropose(cmd *Command, shard int32, leader, execReplica string, replicaList []string, ...) (bool, bool, string)
- func (c *DynamicClient) FastPaxosPropose(cmd *Command, shard int32, leader string, followerList []string, t int64) (bool, bool, string)
- func (c *DynamicClient) InitConn(addrList []string)
- func (c *DynamicClient) PaxosPropose(cmd *Command, addr string) (bool, string)
- func (c *DynamicClient) Probe(addr string) (int64, int32)
- func (c *DynamicClient) ProbeTime(addr string) (int64, int32)
- func (c *DynamicClient) Test(addrList []string)
- type DynamicPaxos
- func (dp *DynamicPaxos) DelFpCmdSlowConsRet(t int64)
- func (dp *DynamicPaxos) EnablePaxosFutureTime(s *Server)
- func (dp *DynamicPaxos) FpReplicaAccept(cmd *Command, fpT *Timestamp) bool
- func (dp *DynamicPaxos) FpWaitConsensus(t int64, cmdId string) (bool, bool)
- func (dp *DynamicPaxos) GetCurFpShard() int32
- func (dp *DynamicPaxos) GetCurPaxosShard() int32
- func (dp *DynamicPaxos) GetExecCh() <-chan Entry
- func (dp *DynamicPaxos) GetIo() ReplicaIo
- func (dp *DynamicPaxos) MarkFpCmdSlowConsRet(t int64, cmdIdMap map[string]bool)
- func (dp *DynamicPaxos) PaxosLeaderAccept(cmd *Command) bool
- func (dp *DynamicPaxos) Probe() time.Duration
- func (dp *DynamicPaxos) ProcessReplicaMsg(msg *ReplicaMsg)
- func (dp *DynamicPaxos) SetFpCmdConsRet(t int64, cmdId string, isAccept, isFast bool)
- func (dp *DynamicPaxos) SetFpCmdConsRetExecT(t int64)
- func (dp *DynamicPaxos) Start(hbDelay time.Duration)
- func (dp *DynamicPaxos) Test()
- type DynamicPaxosClient
- type DynamicPaxosServer
- type DynamicPaxos_DeliverReplicaMsgClient
- type DynamicPaxos_DeliverReplicaMsgServer
- type DynamicPaxos_FpProposeClient
- type DynamicPaxos_FpProposeServer
- type EmptyReply
- type Entry
- type ExecManager
- type ExecRet
- type FastIo
- func (io *FastIo) BcstReplicaMsg(addrList []string, msg *ReplicaMsg)
- func (fIo *FastIo) InitConn(addrList []string, streamBufSize int)
- func (io *FastIo) SendReplicaMsg(addr string, msg *ReplicaMsg)
- func (fIo *FastIo) SendReplicaProbeReq(addr string) *ReplicaProbeReply
- func (fIo *FastIo) SetServer(s *Server)
- func (fIo *FastIo) WaitForClientConn()
- type FpCmdCons
- type FpCmdConsRet
- type FpCmdConsRetManager
- type FpCmdSlowConsRet
- type FpCons
- func (cons *FpCons) Accept(cmd *Command) int
- func (cons *FpCons) ChooseCmd(cmd *Command)
- func (cons *FpCons) GetAcceptN() int
- func (cons *FpCons) GetCmdIdMap() map[string]bool
- func (cons *FpCons) GetRejectCmdIdList() []string
- func (cons *FpCons) GetT() int64
- func (cons *FpCons) IsCmdChosen() bool
- func (cons *FpCons) IsSetFpCmdConsRet(cmdId string) bool
- func (cons *FpCons) SelectCmd(majority int) *Command
- func (cons *FpCons) SetFpCmdConsRet(cmdId string)
- type FpConsManager
- func (m *FpConsManager) AddSlowFpCons(cons *FpCons)
- func (m *FpConsManager) DelSlowFpCons(t int64)
- func (m *FpConsManager) GetFpCons(t int64) *FpCons
- func (m *FpConsManager) GetSlowFpCons(t int64) *FpCons
- func (m *FpConsManager) PeekCons() (*FpCons, bool)
- func (m *FpConsManager) PopCons() *FpCons
- func (m *FpConsManager) Test()
- type FpExecTimeManager
- func (tm *FpExecTimeManager) GetExecT() int64
- func (tm *FpExecTimeManager) GetFastNonAcceptT(rId string) int64
- func (tm *FpExecTimeManager) GetFastQuorumNonAcceptT() (int64, string)
- func (tm *FpExecTimeManager) GetMinNonAcceptT() (int64, string)
- func (tm *FpExecTimeManager) Test()
- func (tm *FpExecTimeManager) UpdateExecT(t int64)
- func (tm *FpExecTimeManager) UpdateNonAcceptTime(rId string, nat int64)
- type FpLog
- type FpProposal
- type FpProposeReply
- func (*FpProposeReply) Descriptor() ([]byte, []int)
- func (m *FpProposeReply) GetCmdId() string
- func (m *FpProposeReply) GetExecRet() string
- func (m *FpProposeReply) GetIsAccept() bool
- func (m *FpProposeReply) GetIsFast() bool
- func (*FpProposeReply) ProtoMessage()
- func (m *FpProposeReply) Reset()
- func (m *FpProposeReply) String() string
- type FpProposeReq
- type FpReply
- type GrpcIo
- type LatInfo
- type LatReq
- type Log
- type LogManager
- type NetIo
- type Paxos
- type PaxosCons
- type PaxosLog
- type PaxosProposal
- type PaxosProposeReply
- func (*PaxosProposeReply) Descriptor() ([]byte, []int)
- func (m *PaxosProposeReply) GetCmdId() string
- func (m *PaxosProposeReply) GetExecRet() string
- func (m *PaxosProposeReply) GetIsCommit() bool
- func (*PaxosProposeReply) ProtoMessage()
- func (m *PaxosProposeReply) Reset()
- func (m *PaxosProposeReply) String() string
- type PaxosProposeReq
- type ProbeReply
- type ProbeReq
- type ProbeTimeReply
- type ReplicaIo
- type ReplicaLatInfo
- type ReplicaMsg
- func (*ReplicaMsg) Descriptor() ([]byte, []int)
- func (m *ReplicaMsg) GetCmd() *Command
- func (m *ReplicaMsg) GetFpExecT() *Timestamp
- func (m *ReplicaMsg) GetIsAccept() bool
- func (m *ReplicaMsg) GetNonAcceptT() int64
- func (m *ReplicaMsg) GetReplicaId() string
- func (m *ReplicaMsg) GetTime() *Timestamp
- func (m *ReplicaMsg) GetType() int32
- func (*ReplicaMsg) ProtoMessage()
- func (m *ReplicaMsg) Reset()
- func (m *ReplicaMsg) String() string
- type ReplicaProbeReply
- type RpcIo
- type Server
- func (s *Server) DeliverReplicaMsg(stream DynamicPaxos_DeliverReplicaMsgServer) error
- func (s *Server) FpPropose(req *FpProposeReq, stream DynamicPaxos_FpProposeServer) error
- func (s *Server) GetExecCh() <-chan Entry
- func (s *Server) GetExecManager() *ExecManager
- func (s *Server) PaxosPropose(ctx context.Context, req *PaxosProposeReq) (*PaxosProposeReply, error)
- func (s *Server) PredictPaxosLat() int64
- func (s *Server) Probe(ctx context.Context, req *ProbeReq) (*ProbeReply, error)
- func (s *Server) ProbeTime(ctx context.Context, req *ProbeReq) (*ProbeTimeReply, error)
- func (s *Server) ReplicaProbe(ctx context.Context, req *ProbeReq) (*ReplicaProbeReply, error)
- func (s *Server) Start(port string)
- func (s *Server) Test(ctx context.Context, req *TestReq) (*TestReply, error)
- type SimpleLogManager
- func (lm *SimpleLogManager) Exec()
- func (lm *SimpleLogManager) FpAcceptCmd(t *Timestamp, cmd *Command)
- func (lm *SimpleLogManager) FpCommitCmd(t *Timestamp, cmd *Command, isFast bool)
- func (lm *SimpleLogManager) FpFastAcceptCmd(t *Timestamp, cmd *Command) bool
- func (lm *SimpleLogManager) GetExecCh() <-chan Entry
- func (lm *SimpleLogManager) PaxosAcceptCmd(t *Timestamp, cmd *Command)
- func (lm *SimpleLogManager) PaxosCommitCmd(t *Timestamp, cmdId string)
- func (lm *SimpleLogManager) PrepareShardExec(shard int32)
- func (lm *SimpleLogManager) Test()
- func (lm *SimpleLogManager) UpdateFpMinExecT(t *Timestamp) bool
- func (lm *SimpleLogManager) UpdatePaxosMinExecT(t *Timestamp)
- type StreamIo
- func (io *StreamIo) BcstFpAccept(addrList []string, t *Timestamp, cmd *Command, execT *Timestamp, nat int64, ...)
- func (io *StreamIo) BcstFpCommit(addrList []string, t *Timestamp, cmd *Command, isFast bool, execT *Timestamp, ...)
- func (io *StreamIo) BcstFpFastVote(addrList []string, t *Timestamp, cmd *Command, isFastAccept bool, nat int64, ...)
- func (io *StreamIo) BcstHb(addrList []string, nat int64, rId string, fpExecT *Timestamp)
- func (io *StreamIo) BcstPaxosAcceptReq(addrList []string, t *Timestamp, cmd *Command, rId string, fpExecT *Timestamp)
- func (io *StreamIo) BcstPaxosCommitReq(addrList []string, t *Timestamp, cmdId string, nat int64, rId string, ...)
- func (io *StreamIo) BcstPaxosFutureAcceptReq(addrList []string, t *Timestamp, cmd *Command, rId string, nat int64, ...)
- func (io *StreamIo) InitConn(addrList []string, streamBufSize int)
- func (io *StreamIo) SendFpAcceptReply(addr string, t *Timestamp, cmdId string, nat int64, rId string)
- func (io *StreamIo) SendFpFastVote(addr string, t *Timestamp, cmd *Command, isFastAccept bool, nat int64, ...)
- func (io *StreamIo) SendPaxosAcceptReply(addr string, t *Timestamp, cmdId string, nat int64, rId string, ...)
- func (io *StreamIo) SyncSendReplicaProbeReq(addr string) *ReplicaProbeReply
- type SyncNetIo
- type TestReply
- type TestReq
- type TimeManager
- type Timestamp
Constants ¶
const ( INVALID_FP_IDX = -1 INVALID_SHARD = -1 )
const ( REPLICA_MSG_HEART_BEAT = 0 REPLICA_MSG_PAXOS_ACCEPT_REQ = 1 REPLICA_MSG_PAXOS_ACCEPT_REPLY = 2 REPLICA_MSG_PAXOS_COMMIT_REQ = 3 //REPLICA_MSG_PAXOS_COMMIT_REPLY = 4 REPLICA_MSG_FP_VOTE = 11 REPLICA_MSG_FP_ACCEPT_REQ = 12 REPLICA_MSG_FP_ACCEPT_REPLY = 13 REPLICA_MSG_FP_COMMIT_REQ = 14 )
Message types for communications among replicas
const ( ENTRY_STAT_COMMITTED = 1 ENTRY_STAT_LEADER_ACCEPTED = 2 ENTRY_STAT_ACCEPTOR_ACCEPTED = 3 // the fast path in Fast Paxos )
const ( Msg_Type_PaxosProposeReq uint8 = iota Msg_Type_PaxosProposeReply Msg_Type_FpProposeReq Msg_Type_FpProposeReply Msg_Type_ReplicaMsg //Msg_Type_EmptyReply Msg_Type_TestReq Msg_Type_TestReply )
const (
DEFAULT_CHANNEL_BUFFER_SIZE = 10240 * 8
)
const ( // Time to wait for other servers to init before sending the first heart beat DEFAULT_FIRST_HEART_BEAT_DELAY = 5 * 1000 * 1000 * 1000 // ns )
const (
DEFAULT_PAXOS_LOG_INIT_SIZE = 1024 * 32
)
const (
NO_OP_ID = "NO_OP_ID"
)
Variables ¶
This section is empty.
Functions ¶
func CompareTime ¶
Returns 0 if t1 == t2 Returns -1 if t1 < t2 Returns 1 if t1 > t2
func RegisterDynamicPaxosServer ¶
func RegisterDynamicPaxosServer(s *grpc.Server, srv DynamicPaxosServer)
Types ¶
type Client ¶
type Client interface { // Returns isCommitted, the accepted time slot, execRet PaxosPropose(c *Command, leader string) (bool, string) // Returns isCommitted, isFast, the accepted time slot, execRet FastPaxosPropose( c *Command, shard int32, leader string, followerList []string, t int64, ) (bool, bool, string) // Fast Paxos all leaners, for reducing execution latency ExecFastPaxosPropose( c *Command, shard int32, leader, execReplica string, replicaList []string, t int64, ) (bool, bool, string) // Latency monitoring // Returns the queuing delay in ns and Paxos latency in ms Probe(addr string) (int64, int32) ProbeTime(addr string) (int64, int32) InitConn(addrList []string) // Shuts down Close() // Testing Test(addrList []string) }
func NewDynamicClient ¶
type ClientFastIo ¶
type ClientFastIo struct {
// contains filtered or unexported fields
}
func (*ClientFastIo) BcstFpProposeToFollowers ¶
func (fIo *ClientFastIo) BcstFpProposeToFollowers( addrList []string, req *FpProposeReq, fastC chan<- *FpProposeReply, wg *sync.WaitGroup, )
Non-blocking
func (*ClientFastIo) InitConn ¶
func (fIo *ClientFastIo) InitConn(addrList []string)
func (*ClientFastIo) SendFpProposeToExecReplica ¶
func (io *ClientFastIo) SendFpProposeToExecReplica( addr string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, wg *sync.WaitGroup, )
Non-blocking
func (*ClientFastIo) SendFpProposeToLeader ¶
func (fIo *ClientFastIo) SendFpProposeToLeader( leader string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, wg *sync.WaitGroup, )
Non-blocking
func (*ClientFastIo) SendPaxosProposeReq ¶
func (fIo *ClientFastIo) SendPaxosProposeReq(addr string, cmd *Command) *PaxosProposeReply
Blocking
func (*ClientFastIo) SendProbeReq ¶
func (fIo *ClientFastIo) SendProbeReq(addr string) *ProbeReply
func (*ClientFastIo) SendProbeTimeReq ¶
func (fIo *ClientFastIo) SendProbeTimeReq(addr string) *ProbeTimeReply
func (*ClientFastIo) SendTestReq ¶
func (fIo *ClientFastIo) SendTestReq(addr string)
type ClientGrpc ¶
type ClientGrpc struct {
// contains filtered or unexported fields
}
func (*ClientGrpc) BcstFpProposeToFollowers ¶
func (gIo *ClientGrpc) BcstFpProposeToFollowers( addrList []string, req *FpProposeReq, fastC chan<- *FpProposeReply, wg *sync.WaitGroup, )
Non-blocking
func (*ClientGrpc) InitConn ¶
func (gIo *ClientGrpc) InitConn(addrList []string)
func (*ClientGrpc) SendFpProposeToExecReplica ¶
func (gIo *ClientGrpc) SendFpProposeToExecReplica( addr string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, wg *sync.WaitGroup, )
Non-blocking
func (*ClientGrpc) SendFpProposeToLeader ¶
func (gIo *ClientGrpc) SendFpProposeToLeader( leaderAddr string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, wg *sync.WaitGroup, )
Non-blocking
func (*ClientGrpc) SendPaxosProposeReq ¶
func (gIo *ClientGrpc) SendPaxosProposeReq( addr string, cmd *Command, ) *PaxosProposeReply
func (*ClientGrpc) SendProbeReq ¶
func (gIo *ClientGrpc) SendProbeReq(addr string) *ProbeReply
//////// RPCs for clients ///////////////
func (*ClientGrpc) SendProbeTimeReq ¶
func (gIo *ClientGrpc) SendProbeTimeReq(addr string) *ProbeTimeReply
type ClientIo ¶
type ClientIo interface { InitConn(addrList []string) // Paxos, blocking RPC function SendPaxosProposeReq(addr string, cmd *Command) *PaxosProposeReply // Fast Paxos, non-blocking RPC functions BcstFpProposeToFollowers(addrList []string, req *FpProposeReq, fastC chan<- *FpProposeReply, wg *sync.WaitGroup) SendFpProposeToLeader(addr string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, wg *sync.WaitGroup) // Fast Paxos with all replicas as learners, non-blocking RPC functions SendFpProposeToExecReplica(addr string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, wg *sync.WaitGroup) // Latency monitoring SendProbeReq(addr string) *ProbeReply SendProbeTimeReq(addr string) *ProbeTimeReply // Testing SendTestReq(addr string) }
func NewClientFastIo ¶
func NewClientGrpc ¶
func NewClientGrpc() ClientIo
type CommManager ¶
type CommManager struct {
// contains filtered or unexported fields
}
Server communication table
func NewCommManager ¶
func NewCommManager() *CommManager
func (*CommManager) BuildConnection ¶
func (cm *CommManager) BuildConnection(addr string) *grpc.ClientConn
func (*CommManager) BuildRpcStub ¶
func (cm *CommManager) BuildRpcStub(addr string) DynamicPaxosClient
Builds an RPC stub if not exists. Otherwise, returns the existing one
func (*CommManager) GetConnection ¶
func (cm *CommManager) GetConnection(addr string) (*grpc.ClientConn, bool)
func (*CommManager) GetRpcStub ¶
func (cm *CommManager) GetRpcStub(addr string) (DynamicPaxosClient, bool)
Returns the RPC stub on file
func (*CommManager) NewRpcStub ¶
func (cm *CommManager) NewRpcStub(addr string) DynamicPaxosClient
type Command ¶
type Command struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Type string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"` Key string `protobuf:"bytes,3,opt,name=key" json:"key,omitempty"` Val string `protobuf:"bytes,4,opt,name=val" json:"val,omitempty"` }
func (*Command) Descriptor ¶
func (*Command) ProtoMessage ¶
func (*Command) ProtoMessage()
type DynamicClient ¶
type DynamicClient struct { // If the Fast Paxos leader uses Paxos to accept commonds that arerejected in // Fast Paxos instances IsFpLeaderUsePaxos bool // contains filtered or unexported fields }
func (*DynamicClient) Close ¶
func (c *DynamicClient) Close()
func (*DynamicClient) ExecFastPaxosPropose ¶
func (*DynamicClient) FastPaxosPropose ¶
func (c *DynamicClient) FastPaxosPropose( cmd *Command, shard int32, leader string, followerList []string, t int64, ) (bool, bool, string)
Proposes a command to the given Fast Paxos instance
func (*DynamicClient) InitConn ¶
func (c *DynamicClient) InitConn(addrList []string)
func (*DynamicClient) PaxosPropose ¶
func (c *DynamicClient) PaxosPropose(cmd *Command, addr string) (bool, string)
Proposes a command to the given Paxos instance
type DynamicPaxos ¶
type DynamicPaxos struct { //Replica info ReplicaNum int Majority int FastQuorum int // Network I/O swtich IsGrpc bool // If using gRPC IsSyncSend bool // If doing server network I/O and computation in the same thread // contains filtered or unexported fields }
func (*DynamicPaxos) DelFpCmdSlowConsRet ¶
func (dp *DynamicPaxos) DelFpCmdSlowConsRet(t int64)
func (*DynamicPaxos) EnablePaxosFutureTime ¶
func (dp *DynamicPaxos) EnablePaxosFutureTime(s *Server)
Enables Paxos to assign a request with a future time indicating when the replicaiton would complete. This is used to reduce execution latency.
func (*DynamicPaxos) FpReplicaAccept ¶
func (dp *DynamicPaxos) FpReplicaAccept(cmd *Command, fpT *Timestamp) bool
func (*DynamicPaxos) FpWaitConsensus ¶
func (dp *DynamicPaxos) FpWaitConsensus(t int64, cmdId string) (bool, bool)
Blocking until the consensus result is known
func (*DynamicPaxos) GetCurFpShard ¶
func (dp *DynamicPaxos) GetCurFpShard() int32
func (*DynamicPaxos) GetCurPaxosShard ¶
func (dp *DynamicPaxos) GetCurPaxosShard() int32
func (*DynamicPaxos) GetExecCh ¶
func (dp *DynamicPaxos) GetExecCh() <-chan Entry
func (*DynamicPaxos) GetIo ¶
func (dp *DynamicPaxos) GetIo() ReplicaIo
func (*DynamicPaxos) MarkFpCmdSlowConsRet ¶
func (dp *DynamicPaxos) MarkFpCmdSlowConsRet(t int64, cmdIdMap map[string]bool)
func (*DynamicPaxos) PaxosLeaderAccept ¶
func (dp *DynamicPaxos) PaxosLeaderAccept(cmd *Command) bool
func (*DynamicPaxos) Probe ¶
func (dp *DynamicPaxos) Probe() time.Duration
func (*DynamicPaxos) ProcessReplicaMsg ¶
func (dp *DynamicPaxos) ProcessReplicaMsg(msg *ReplicaMsg)
func (*DynamicPaxos) SetFpCmdConsRet ¶
func (dp *DynamicPaxos) SetFpCmdConsRet(t int64, cmdId string, isAccept, isFast bool)
func (*DynamicPaxos) SetFpCmdConsRetExecT ¶
func (dp *DynamicPaxos) SetFpCmdConsRetExecT(t int64)
type DynamicPaxosClient ¶
type DynamicPaxosClient interface { // Multi-Paxos for clients PaxosPropose(ctx context.Context, in *PaxosProposeReq, opts ...grpc.CallOption) (*PaxosProposeReply, error) // Fast Paxos for clients FpPropose(ctx context.Context, in *FpProposeReq, opts ...grpc.CallOption) (DynamicPaxos_FpProposeClient, error) // Communication between replicas // Heart beat // Paxos Accept & Commit // Fast Paxos Vote // Fast Paxos Accept & Commit // Any above message should piggyback a commit timestamp message for the shard. // This commit timestamp indicates that the replica guarantees that it will // not accept/commit any operation before the timestamp DeliverReplicaMsg(ctx context.Context, opts ...grpc.CallOption) (DynamicPaxos_DeliverReplicaMsgClient, error) // // Network Latency Monitoring // For clients Probe(ctx context.Context, in *ProbeReq, opts ...grpc.CallOption) (*ProbeReply, error) ProbeTime(ctx context.Context, in *ProbeReq, opts ...grpc.CallOption) (*ProbeTimeReply, error) // For replica servers ReplicaProbe(ctx context.Context, in *ProbeReq, opts ...grpc.CallOption) (*ReplicaProbeReply, error) // Testing Test(ctx context.Context, in *TestReq, opts ...grpc.CallOption) (*TestReply, error) }
func NewDynamicPaxosClient ¶
func NewDynamicPaxosClient(cc *grpc.ClientConn) DynamicPaxosClient
type DynamicPaxosServer ¶
type DynamicPaxosServer interface { // Multi-Paxos for clients PaxosPropose(context.Context, *PaxosProposeReq) (*PaxosProposeReply, error) // Fast Paxos for clients FpPropose(*FpProposeReq, DynamicPaxos_FpProposeServer) error // Communication between replicas // Heart beat // Paxos Accept & Commit // Fast Paxos Vote // Fast Paxos Accept & Commit // Any above message should piggyback a commit timestamp message for the shard. // This commit timestamp indicates that the replica guarantees that it will // not accept/commit any operation before the timestamp DeliverReplicaMsg(DynamicPaxos_DeliverReplicaMsgServer) error // // Network Latency Monitoring // For clients Probe(context.Context, *ProbeReq) (*ProbeReply, error) ProbeTime(context.Context, *ProbeReq) (*ProbeTimeReply, error) // For replica servers ReplicaProbe(context.Context, *ProbeReq) (*ReplicaProbeReply, error) // Testing Test(context.Context, *TestReq) (*TestReply, error) }
type DynamicPaxos_DeliverReplicaMsgClient ¶
type DynamicPaxos_DeliverReplicaMsgClient interface { Send(*ReplicaMsg) error CloseAndRecv() (*EmptyReply, error) grpc.ClientStream }
type DynamicPaxos_DeliverReplicaMsgServer ¶
type DynamicPaxos_DeliverReplicaMsgServer interface { SendAndClose(*EmptyReply) error Recv() (*ReplicaMsg, error) grpc.ServerStream }
type DynamicPaxos_FpProposeClient ¶
type DynamicPaxos_FpProposeClient interface { Recv() (*FpProposeReply, error) grpc.ClientStream }
type DynamicPaxos_FpProposeServer ¶
type DynamicPaxos_FpProposeServer interface { Send(*FpProposeReply) error grpc.ServerStream }
type EmptyReply ¶
type EmptyReply struct { }
func (*EmptyReply) Descriptor ¶
func (*EmptyReply) Descriptor() ([]byte, []int)
func (*EmptyReply) ProtoMessage ¶
func (*EmptyReply) ProtoMessage()
func (*EmptyReply) Reset ¶
func (m *EmptyReply) Reset()
func (*EmptyReply) String ¶
func (m *EmptyReply) String() string
type ExecManager ¶
type ExecManager struct {
// contains filtered or unexported fields
}
func NewExecmanager ¶
func NewExecmanager() *ExecManager
func (*ExecManager) DelExecRet ¶
func (em *ExecManager) DelExecRet(cmdId string)
func (*ExecManager) GetExecRet ¶
func (em *ExecManager) GetExecRet(cmdId string) *ExecRet
func (*ExecManager) Size ¶
func (em *ExecManager) Size() int
func (*ExecManager) WaitExecRet ¶
func (em *ExecManager) WaitExecRet(cmdId string) string
Waits for execution result to be ready Blocks until execution result is available
type FastIo ¶
type FastIo struct { PeerAddrList []string PeerNetIo []NetIo Id int // replica Id starting from 0 N int // number of replicas Listener net.Listener // contains filtered or unexported fields }
func (*FastIo) BcstReplicaMsg ¶
func (io *FastIo) BcstReplicaMsg(addrList []string, msg *ReplicaMsg)
func (*FastIo) SendReplicaMsg ¶
func (io *FastIo) SendReplicaMsg(addr string, msg *ReplicaMsg)
func (*FastIo) SendReplicaProbeReq ¶
func (fIo *FastIo) SendReplicaProbeReq(addr string) *ReplicaProbeReply
func (*FastIo) WaitForClientConn ¶
func (fIo *FastIo) WaitForClientConn()
////////////////////////////////////// Handles client RPCs
type FpCmdCons ¶
type FpCmdCons struct {
// contains filtered or unexported fields
}
func NewFpCmdCons ¶
func NewFpCmdCons() *FpCmdCons
type FpCmdConsRetManager ¶
type FpCmdConsRetManager struct {
// contains filtered or unexported fields
}
func NewFpCmdConsRetManager ¶
func NewFpCmdConsRetManager(size int) *FpCmdConsRetManager
func (*FpCmdConsRetManager) Test ¶
func (m *FpCmdConsRetManager) Test()
type FpCmdSlowConsRet ¶
type FpCons ¶
type FpCons struct {
// contains filtered or unexported fields
}
Fast Paxos consensus instance
func (*FpCons) GetAcceptN ¶
Returns the number of accepted commands
func (*FpCons) GetCmdIdMap ¶
func (*FpCons) GetRejectCmdIdList ¶
func (*FpCons) IsCmdChosen ¶
func (*FpCons) IsSetFpCmdConsRet ¶
func (*FpCons) SetFpCmdConsRet ¶
type FpConsManager ¶
type FpConsManager struct {
// contains filtered or unexported fields
}
Fast Paxos shard consensus instance manager
func NewFpConsManager ¶
func NewFpConsManager(initSize int) *FpConsManager
func (*FpConsManager) AddSlowFpCons ¶
func (m *FpConsManager) AddSlowFpCons(cons *FpCons)
func (*FpConsManager) DelSlowFpCons ¶
func (m *FpConsManager) DelSlowFpCons(t int64)
func (*FpConsManager) GetFpCons ¶
func (m *FpConsManager) GetFpCons(t int64) *FpCons
func (*FpConsManager) GetSlowFpCons ¶
func (m *FpConsManager) GetSlowFpCons(t int64) *FpCons
func (*FpConsManager) PeekCons ¶
func (m *FpConsManager) PeekCons() (*FpCons, bool)
func (*FpConsManager) PopCons ¶
func (m *FpConsManager) PopCons() *FpCons
type FpExecTimeManager ¶
type FpExecTimeManager struct {
// contains filtered or unexported fields
}
Fast Paxos shard execution time manager
func NewFpExecTimeManager ¶
func NewFpExecTimeManager(rN int, fastQuorum int, rIdList []string) *FpExecTimeManager
func (*FpExecTimeManager) GetExecT ¶
func (tm *FpExecTimeManager) GetExecT() int64
func (*FpExecTimeManager) GetFastNonAcceptT ¶
func (tm *FpExecTimeManager) GetFastNonAcceptT(rId string) int64
func (*FpExecTimeManager) GetFastQuorumNonAcceptT ¶
func (tm *FpExecTimeManager) GetFastQuorumNonAcceptT() (int64, string)
func (*FpExecTimeManager) GetMinNonAcceptT ¶
func (tm *FpExecTimeManager) GetMinNonAcceptT() (int64, string)
func (*FpExecTimeManager) Test ¶
func (tm *FpExecTimeManager) Test()
func (*FpExecTimeManager) UpdateExecT ¶
func (tm *FpExecTimeManager) UpdateExecT(t int64)
func (*FpExecTimeManager) UpdateNonAcceptTime ¶
func (tm *FpExecTimeManager) UpdateNonAcceptTime(rId string, nat int64)
type FpProposal ¶
type FpProposeReply ¶
type FpProposeReply struct { IsAccept bool `protobuf:"varint,1,opt,name=isAccept" json:"isAccept,omitempty"` IsFast bool `protobuf:"varint,2,opt,name=isFast" json:"isFast,omitempty"` ExecRet string `protobuf:"bytes,3,opt,name=execRet" json:"execRet,omitempty"` CmdId string `protobuf:"bytes,4,opt,name=cmdId" json:"cmdId,omitempty"` }
func (*FpProposeReply) Descriptor ¶
func (*FpProposeReply) Descriptor() ([]byte, []int)
func (*FpProposeReply) GetCmdId ¶
func (m *FpProposeReply) GetCmdId() string
func (*FpProposeReply) GetExecRet ¶
func (m *FpProposeReply) GetExecRet() string
func (*FpProposeReply) GetIsAccept ¶
func (m *FpProposeReply) GetIsAccept() bool
func (*FpProposeReply) GetIsFast ¶
func (m *FpProposeReply) GetIsFast() bool
func (*FpProposeReply) ProtoMessage ¶
func (*FpProposeReply) ProtoMessage()
func (*FpProposeReply) Reset ¶
func (m *FpProposeReply) Reset()
func (*FpProposeReply) String ¶
func (m *FpProposeReply) String() string
type FpProposeReq ¶
type FpProposeReq struct { Cmd *Command `protobuf:"bytes,1,opt,name=cmd" json:"cmd,omitempty"` Time *Timestamp `protobuf:"bytes,2,opt,name=time" json:"time,omitempty"` IsExecReply bool `protobuf:"varint,3,opt,name=isExecReply" json:"isExecReply,omitempty"` }
func (*FpProposeReq) Descriptor ¶
func (*FpProposeReq) Descriptor() ([]byte, []int)
func (*FpProposeReq) GetCmd ¶
func (m *FpProposeReq) GetCmd() *Command
func (*FpProposeReq) GetIsExecReply ¶
func (m *FpProposeReq) GetIsExecReply() bool
func (*FpProposeReq) GetTime ¶
func (m *FpProposeReq) GetTime() *Timestamp
func (*FpProposeReq) ProtoMessage ¶
func (*FpProposeReq) ProtoMessage()
func (*FpProposeReq) Reset ¶
func (m *FpProposeReq) Reset()
func (*FpProposeReq) String ¶
func (m *FpProposeReq) String() string
type GrpcIo ¶
type GrpcIo struct {
// contains filtered or unexported fields
}
///////////////////////////////// gRPC streaming implementation
func (*GrpcIo) BcstReplicaMsg ¶
func (io *GrpcIo) BcstReplicaMsg(addrList []string, msg *ReplicaMsg)
func (*GrpcIo) SendReplicaMsg ¶
func (io *GrpcIo) SendReplicaMsg(addr string, msg *ReplicaMsg)
func (*GrpcIo) SendReplicaProbeReq ¶
func (io *GrpcIo) SendReplicaProbeReq(addr string) *ReplicaProbeReply
Synchoronous I/O
type Log ¶
type Log interface { PeekMin() (Entry, bool) PopMin() (Entry, bool) Put(t int64, e Entry) Get(t int64) (Entry, bool) Del(t int64) IsFpLog() bool // Testing Test() }
func NewPaxosLog ¶
func NewPaxosLog() Log
type LogManager ¶
type LogManager interface { //Updates the min execution time among all Paxos and Fast Paxos shards UpdatePaxosMinExecT(t *Timestamp) UpdateFpMinExecT(t *Timestamp) bool // Paxos PaxosAcceptCmd(t *Timestamp, cmd *Command) PaxosCommitCmd(t *Timestamp, cmdId string) // Fast Paxos // Fast-path accept a client's command FpFastAcceptCmd(t *Timestamp, cmd *Command) bool // Slow-path accept a command FpAcceptCmd(t *Timestamp, cmd *Command) // Fast-path / slow-path commit a command FpCommitCmd(t *Timestamp, cmd *Command, isFast bool) // Preapres a shard for execution PrepareShardExec(shard int32) // Execution Exec() GetExecCh() <-chan Entry // Testing Test() }
func NewSimpleLogManager ¶
func NewSimpleLogManager( pShardList []int32, fpShardList []int32, execChSize int, ) LogManager
type NetIo ¶
type Paxos ¶
type Paxos interface { // Paxos assignes a request with a future time when the replication completes EnablePaxosFutureTime(s *Server) Start(hbDelay time.Duration) // Probing message for latency monitoring // Returns the queuing (i.e., processing delay) Probe() time.Duration // Returns isCommitted PaxosLeaderAccept(cmd *Command) bool // Returns isAccepted (A cmd gets rejected if the timestamp passes the current time) FpReplicaAccept(cmd *Command, fpT *Timestamp) bool // Processes messages between replicas ProcessReplicaMsg(msg *ReplicaMsg) // Fast Paxos shard leader waits for consensus result FpWaitConsensus(t int64, cmdId string) (bool, bool) // Returns the Paxos shard ID that this replica is the leader GetCurPaxosShard() int32 // Returns the Fast Paxos shard ID that this replica is the leader GetCurFpShard() int32 // Returns the command execution channel for applications GetExecCh() <-chan Entry // Returns RPC I/O handle TODO Decouples I/O from Paxos module GetIo() ReplicaIo // Testing Test() }
func NewDynamicPaxos ¶
func NewDynamicPaxos( replicaId string, replicaIdAddrMap map[string]string, rIdList, nodeAddrList []string, pShard, fpShard int32, pShardLeaderIdMap, fpShardLeaderIdMap map[int32]string, followerAddrList []string, hbInterval time.Duration, cmdChSize int, execChSize int, isGrpc, isSyncSend bool, isFpLeaderLearner bool, ) Paxos
type PaxosCons ¶
type PaxosCons struct {
// contains filtered or unexported fields
}
Paxos consenus instance
func NewPaxosCons ¶
func (*PaxosCons) VoteAccept ¶
type PaxosLog ¶
type PaxosLog struct {
// contains filtered or unexported fields
}
type PaxosProposal ¶
type PaxosProposeReply ¶
type PaxosProposeReply struct { IsCommit bool `protobuf:"varint,1,opt,name=isCommit" json:"isCommit,omitempty"` ExecRet string `protobuf:"bytes,2,opt,name=execRet" json:"execRet,omitempty"` CmdId string `protobuf:"bytes,3,opt,name=cmdId" json:"cmdId,omitempty"` }
func (*PaxosProposeReply) Descriptor ¶
func (*PaxosProposeReply) Descriptor() ([]byte, []int)
func (*PaxosProposeReply) GetCmdId ¶
func (m *PaxosProposeReply) GetCmdId() string
func (*PaxosProposeReply) GetExecRet ¶
func (m *PaxosProposeReply) GetExecRet() string
func (*PaxosProposeReply) GetIsCommit ¶
func (m *PaxosProposeReply) GetIsCommit() bool
func (*PaxosProposeReply) ProtoMessage ¶
func (*PaxosProposeReply) ProtoMessage()
func (*PaxosProposeReply) Reset ¶
func (m *PaxosProposeReply) Reset()
func (*PaxosProposeReply) String ¶
func (m *PaxosProposeReply) String() string
type PaxosProposeReq ¶
type PaxosProposeReq struct {
Cmd *Command `protobuf:"bytes,1,opt,name=cmd" json:"cmd,omitempty"`
}
func (*PaxosProposeReq) Descriptor ¶
func (*PaxosProposeReq) Descriptor() ([]byte, []int)
func (*PaxosProposeReq) GetCmd ¶
func (m *PaxosProposeReq) GetCmd() *Command
func (*PaxosProposeReq) ProtoMessage ¶
func (*PaxosProposeReq) ProtoMessage()
func (*PaxosProposeReq) Reset ¶
func (m *PaxosProposeReq) Reset()
func (*PaxosProposeReq) String ¶
func (m *PaxosProposeReq) String() string
type ProbeReply ¶
type ProbeReply struct { QueuingDelay int64 `protobuf:"varint,1,opt,name=queuingDelay" json:"queuingDelay,omitempty"` PaxosLat int32 `protobuf:"varint,2,opt,name=paxosLat" json:"paxosLat,omitempty"` }
func (*ProbeReply) Descriptor ¶
func (*ProbeReply) Descriptor() ([]byte, []int)
func (*ProbeReply) GetPaxosLat ¶
func (m *ProbeReply) GetPaxosLat() int32
func (*ProbeReply) GetQueuingDelay ¶
func (m *ProbeReply) GetQueuingDelay() int64
func (*ProbeReply) ProtoMessage ¶
func (*ProbeReply) ProtoMessage()
func (*ProbeReply) Reset ¶
func (m *ProbeReply) Reset()
func (*ProbeReply) String ¶
func (m *ProbeReply) String() string
type ProbeReq ¶
type ProbeReq struct { }
func (*ProbeReq) Descriptor ¶
func (*ProbeReq) ProtoMessage ¶
func (*ProbeReq) ProtoMessage()
type ProbeTimeReply ¶
type ProbeTimeReply struct { ProcessTime int64 `protobuf:"varint,1,opt,name=processTime" json:"processTime,omitempty"` PaxosLat int32 `protobuf:"varint,2,opt,name=paxosLat" json:"paxosLat,omitempty"` }
func (*ProbeTimeReply) Descriptor ¶
func (*ProbeTimeReply) Descriptor() ([]byte, []int)
func (*ProbeTimeReply) GetPaxosLat ¶
func (m *ProbeTimeReply) GetPaxosLat() int32
func (*ProbeTimeReply) GetProcessTime ¶
func (m *ProbeTimeReply) GetProcessTime() int64
func (*ProbeTimeReply) ProtoMessage ¶
func (*ProbeTimeReply) ProtoMessage()
func (*ProbeTimeReply) Reset ¶
func (m *ProbeTimeReply) Reset()
func (*ProbeTimeReply) String ¶
func (m *ProbeTimeReply) String() string
type ReplicaIo ¶
type ReplicaIo interface { InitConn(addrList []string, streamBufSize int) // A replica broadcasts heart beat to others BcstHb(addrList []string, nat int64, rId string, fpExecT *Timestamp) // Paxos shard leader BcstPaxosAcceptReq(addrList []string, t *Timestamp, cmd *Command, rId string, fpExecT *Timestamp) BcstPaxosFutureAcceptReq(addrList []string, t *Timestamp, cmd *Command, rId string, nat int64, fpExecT *Timestamp) // Piggybacks current commit time BcstPaxosCommitReq(addrList []string, t *Timestamp, cmdId string, nat int64, rId string, fpExecT *Timestamp) // Paxos shard follower // Piggybacks current commit time SendPaxosAcceptReply(addr string, t *Timestamp, cmdId string, nat int64, rId string, fpExecT *Timestamp) // Fast Paxos shard leader BcstFpAccept(addrList []string, t *Timestamp, cmd *Command, execT *Timestamp, nat int64, rId string) BcstFpCommit(addrList []string, t *Timestamp, cmd *Command, isFast bool, execT *Timestamp, nat int64, rId string) // Fast Paxos all learners BcstFpFastVote(addrList []string, t *Timestamp, cmd *Command, isFastAccept bool, nat int64, rId string) // Fast Paxos shard follower SendFpFastVote(addr string, t *Timestamp, cmd *Command, isFastAccept bool, nat int64, rId string) SendFpAcceptReply(addr string, t *Timestamp, cmdId string, nat int64, rId string) // Blocking // Synchronous I/O Latency probing // TODO to be piggybacked on the heart beat message SyncSendReplicaProbeReq(addr string) *ReplicaProbeReply }
type ReplicaLatInfo ¶
type ReplicaLatInfo struct {
// contains filtered or unexported fields
}
type ReplicaMsg ¶
type ReplicaMsg struct { Type int32 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"` Cmd *Command `protobuf:"bytes,2,opt,name=cmd" json:"cmd,omitempty"` Time *Timestamp `protobuf:"bytes,3,opt,name=time" json:"time,omitempty"` IsAccept bool `protobuf:"varint,4,opt,name=isAccept" json:"isAccept,omitempty"` NonAcceptT int64 `protobuf:"varint,5,opt,name=nonAcceptT" json:"nonAcceptT,omitempty"` ReplicaId string `protobuf:"bytes,6,opt,name=replicaId" json:"replicaId,omitempty"` FpExecT *Timestamp `protobuf:"bytes,7,opt,name=fpExecT" json:"fpExecT,omitempty"` }
func (*ReplicaMsg) Descriptor ¶
func (*ReplicaMsg) Descriptor() ([]byte, []int)
func (*ReplicaMsg) GetCmd ¶
func (m *ReplicaMsg) GetCmd() *Command
func (*ReplicaMsg) GetFpExecT ¶
func (m *ReplicaMsg) GetFpExecT() *Timestamp
func (*ReplicaMsg) GetIsAccept ¶
func (m *ReplicaMsg) GetIsAccept() bool
func (*ReplicaMsg) GetNonAcceptT ¶
func (m *ReplicaMsg) GetNonAcceptT() int64
func (*ReplicaMsg) GetReplicaId ¶
func (m *ReplicaMsg) GetReplicaId() string
func (*ReplicaMsg) GetTime ¶
func (m *ReplicaMsg) GetTime() *Timestamp
func (*ReplicaMsg) GetType ¶
func (m *ReplicaMsg) GetType() int32
func (*ReplicaMsg) ProtoMessage ¶
func (*ReplicaMsg) ProtoMessage()
func (*ReplicaMsg) Reset ¶
func (m *ReplicaMsg) Reset()
func (*ReplicaMsg) String ¶
func (m *ReplicaMsg) String() string
type ReplicaProbeReply ¶
type ReplicaProbeReply struct {
QueuingDelay int64 `protobuf:"varint,1,opt,name=queuingDelay" json:"queuingDelay,omitempty"`
}
func (*ReplicaProbeReply) Descriptor ¶
func (*ReplicaProbeReply) Descriptor() ([]byte, []int)
func (*ReplicaProbeReply) GetQueuingDelay ¶
func (m *ReplicaProbeReply) GetQueuingDelay() int64
func (*ReplicaProbeReply) ProtoMessage ¶
func (*ReplicaProbeReply) ProtoMessage()
func (*ReplicaProbeReply) Reset ¶
func (m *ReplicaProbeReply) Reset()
func (*ReplicaProbeReply) String ¶
func (m *ReplicaProbeReply) String() string
type RpcIo ¶
type RpcIo interface { InitConn(addrList []string, streamBufSize int) // FIFO communication and processing between replicas BcstReplicaMsg(addrList []string, msg *ReplicaMsg) SendReplicaMsg(addr string, msg *ReplicaMsg) // Synchoronous I/O Latency probing (not FIFO processing) SendReplicaProbeReq(addr string) *ReplicaProbeReply // contains filtered or unexported methods }
type Server ¶
type Server struct { IsExecReply bool // True if reply execution ret IsFpLeaderUsePaxos bool IsFpLeaderLearner bool IsGrpc bool // Latency predictions IsLatPrediction bool // contains filtered or unexported fields }
func NewServer ¶
func NewServer( replicaId string, replicaIdAddrMap map[string]string, rIdList, nodeAddrList []string, pShard, fpShard int32, pShardLeaderMap, fpShardLeaderMap map[int32]string, followerAddrList []string, hbInterval time.Duration, cmdChSize int, execChSize int, isExecReply bool, isFpLeaderUsePaxos bool, isGrpc, isSyncSend bool, isFpLeaderLearner bool, isLatPrediction bool, probeInv time.Duration, windowLen time.Duration, windowSize int, predictPth float64, isPaxosFutureTime bool, ) *Server
func (*Server) DeliverReplicaMsg ¶
func (s *Server) DeliverReplicaMsg(stream DynamicPaxos_DeliverReplicaMsgServer) error
func (*Server) FpPropose ¶
func (s *Server) FpPropose(req *FpProposeReq, stream DynamicPaxos_FpProposeServer) error
func (*Server) GetExecManager ¶
func (s *Server) GetExecManager() *ExecManager
func (*Server) PaxosPropose ¶
func (s *Server) PaxosPropose(ctx context.Context, req *PaxosProposeReq) (*PaxosProposeReply, error)
func (*Server) PredictPaxosLat ¶
Predicts the Paxos latency (in ms) when this is the leader
func (*Server) ProbeTime ¶
Time offset probe for clients.
To consider the clock synchronization between clients and servers, a client predicts the time when its request can be processed on each server. Each server returns its clock time to the client, and the client can calculate the offset between its clock time and the server's clock time, which includes the network delay and queuing delay. The client will use the time offset to set its request timestamp.
func (*Server) ReplicaProbe ¶
type SimpleLogManager ¶
type SimpleLogManager struct {
// contains filtered or unexported fields
}
func (*SimpleLogManager) Exec ¶
func (lm *SimpleLogManager) Exec()
func (*SimpleLogManager) FpAcceptCmd ¶
func (lm *SimpleLogManager) FpAcceptCmd(t *Timestamp, cmd *Command)
func (*SimpleLogManager) FpCommitCmd ¶
func (lm *SimpleLogManager) FpCommitCmd(t *Timestamp, cmd *Command, isFast bool)
func (*SimpleLogManager) FpFastAcceptCmd ¶
func (lm *SimpleLogManager) FpFastAcceptCmd(t *Timestamp, cmd *Command) bool
func (*SimpleLogManager) GetExecCh ¶
func (lm *SimpleLogManager) GetExecCh() <-chan Entry
func (*SimpleLogManager) PaxosAcceptCmd ¶
func (lm *SimpleLogManager) PaxosAcceptCmd(t *Timestamp, cmd *Command)
func (*SimpleLogManager) PaxosCommitCmd ¶
func (lm *SimpleLogManager) PaxosCommitCmd(t *Timestamp, cmdId string)
func (*SimpleLogManager) PrepareShardExec ¶
func (lm *SimpleLogManager) PrepareShardExec(shard int32)
func (*SimpleLogManager) Test ¶
func (lm *SimpleLogManager) Test()
func (*SimpleLogManager) UpdateFpMinExecT ¶
func (lm *SimpleLogManager) UpdateFpMinExecT(t *Timestamp) bool
func (*SimpleLogManager) UpdatePaxosMinExecT ¶
func (lm *SimpleLogManager) UpdatePaxosMinExecT(t *Timestamp)
NOTE: for each Paxos shard, the execution time can only be updated to a future one.
type StreamIo ¶
type StreamIo struct {
// contains filtered or unexported fields
}
Not thread-safe
func (*StreamIo) BcstFpAccept ¶
func (io *StreamIo) BcstFpAccept( addrList []string, t *Timestamp, cmd *Command, execT *Timestamp, nat int64, rId string, )
// Fast Paxos A leader sends slow-path accept req to followers
func (*StreamIo) BcstFpCommit ¶
func (io *StreamIo) BcstFpCommit( addrList []string, t *Timestamp, cmd *Command, isFast bool, execT *Timestamp, nat int64, rId string, )
A leader sends fast-path/slow-path commit req to followers
func (*StreamIo) BcstFpFastVote ¶
func (*StreamIo) BcstPaxosAcceptReq ¶
func (io *StreamIo) BcstPaxosAcceptReq( addrList []string, t *Timestamp, cmd *Command, rId string, fpExecT *Timestamp, )
Shard leaders broadcast Paxos accept req to followers
func (*StreamIo) BcstPaxosCommitReq ¶
func (io *StreamIo) BcstPaxosCommitReq( addrList []string, t *Timestamp, cmdId string, nat int64, rId string, fpExecT *Timestamp, )
Shard leaders broadcast Paxos commit req to followers
func (*StreamIo) BcstPaxosFutureAcceptReq ¶
func (*StreamIo) SendFpAcceptReply ¶
func (*StreamIo) SendFpFastVote ¶
func (io *StreamIo) SendFpFastVote( addr string, t *Timestamp, cmd *Command, isFastAccept bool, nat int64, rId string, )
A Fast Paxos shard follower sends a fast-path vote to the leader
func (*StreamIo) SendPaxosAcceptReply ¶
func (io *StreamIo) SendPaxosAcceptReply( addr string, t *Timestamp, cmdId string, nat int64, rId string, fpExecT *Timestamp, )
Follower to leader A follower sends a Paxos accept reply to the shard leader
func (*StreamIo) SyncSendReplicaProbeReq ¶
func (io *StreamIo) SyncSendReplicaProbeReq(addr string) *ReplicaProbeReply
Blocking
type SyncNetIo ¶
type SyncNetIo struct {
// contains filtered or unexported fields
}
func NewSyncNetIo ¶
type TestReply ¶
type TestReply struct { }
func (*TestReply) Descriptor ¶
func (*TestReply) ProtoMessage ¶
func (*TestReply) ProtoMessage()
type TestReq ¶
type TestReq struct { }
func (*TestReq) Descriptor ¶
func (*TestReq) ProtoMessage ¶
func (*TestReq) ProtoMessage()
type TimeManager ¶
func NewRealClockTm ¶
func NewRealClockTm() TimeManager
type Timestamp ¶
type Timestamp struct { Time int64 `protobuf:"varint,1,opt,name=time" json:"time,omitempty"` Shard int32 `protobuf:"varint,2,opt,name=shard" json:"shard,omitempty"` }
func (*Timestamp) Descriptor ¶
func (*Timestamp) ProtoMessage ¶
func (*Timestamp) ProtoMessage()