Interface RaftConfiguration

Configuration that can be provided as part of the RaftControllerOptions. If no configuration is provided the default configuration is used.

Hierarchy

  • RaftConfiguration

Properties

confChangeReproposeInterval?: number

Specifies how long it takes for a configuration change to be reproposed if it was not committed by that time.

If not set, default confChangeReproposeInterval is 1000.

defaultSnapCount?: number

Specifies after how many committed entries a manual snapshot is triggered.

If not set, default defaultSnapCount is 1000.

electionTick?: number

ElectionTick is the number of Node.Tick invocations that must pass between elections. That is, if a follower does not receive any message from the leader of current term before ElectionTick has elapsed, it will become candidate and start an election. ElectionTick must be greater than HeartbeatTick. We suggest ElectionTick = 10 * HeartbeatTick to avoid unnecessary leader switching.

If not set, default electionTick is 10.

heartbeatTick?: number

HeartbeatTick is the number of Node.Tick invocations that must pass between heartbeats. That is, a leader sends heartbeat messages to maintain its leadership every HeartbeatTick ticks.

If not set, default heartbeatTick is 1.

inputReproposeInterval?: number

Specifies how long it takes for an input to be reproposed if it was not committed by that time.

If not set, default inputReproposeInterval is 1000.

joinRequestRetryInterval?: number

Time in ms after which a join request is rebroadcasted to the cluster.

If not set, default joinRequestRetryInterval is 5000.

maxCommittedSizePerReady?: number

MaxCommittedSizePerReady limits the size of the committed entries which can be applied.

If not set, default maxCommittedSizePerReady is 1000.

maxInflightMsgs?: number

MaxInflightMsgs limits the max number of in-flight append messages during optimistic replication phase. The application transportation layer usually has its own sending buffer over TCP/UDP. Setting MaxInflightMsgs to avoid overflowing that sending buffer.

If not set, default maxInflightMsgs is 256.

maxSizePerMsg?: number

MaxSizePerMsg limits the max size of each append message. The size is measured by serializing the message into a string and counting its characters. Smaller value lowers the Raft recovery cost(initial probing and message lost during normal operation). On the other side, it might affect the throughput during normal replication. Note: Number.MAX_VALUE for unlimited, 0 for at most one entry per message.

If not set, default maxSizePerMsg is (1024 * 1024).

maxUncommittedEntriesSize?: number

MaxUncommittedEntriesSize limits the aggregate size of the uncommitted entries that may be appended to a leader's log. The size is measured by serializing the entries into a string and counting its characters. Once this limit is exceeded, proposals will begin to return ErrProposalDropped errors. Note: 0 for no limit.

If not set, default maxUncommittedEntriesSize is 2^30.

queuedUpInputProposalsLimit?: number

Limits the queue for input proposals. Input proposals are rejected if this limit is exceeded.

If not set, default queuedUpInputProposalsLimit is 1000.

raftEntriesKey?: string

Database key for Raft entries.

If not set, default raftEntriesKey is "entries".

raftHardstateKey?: string

Database key for the Raft hardstate.

If not set, default raftHardstateKey is "hardstate".

raftSnapshotKey?: string

Database key for the Raft snapshot.

If not set, default raftSnapshotKey is "snapshot".

runningJoinRequestsLimit?: number

Limits the number of concurrently processed join requests. Join requests are dropped if this limit is exceeded.

If not set, default runningJoinRequestLimit is 1000.

snapshotCatchUpEntriesN?: number

Specifies the index at which a manual snapshot will be taken. If a manual snapshot is taken the application will try to leave the newest snapshotCatchUpEntriesN entries in the log and compact all older entries into a snapshot.

If not set, default snapshotCatchUpEntriesN is 50.

snapshotReceiveTimeout?: number

A snapshot counts as lost if it was not received within this time in ms.

If not set, default snapshotReceiveTimeout is 60000

tickTime?: number

Specifies how long one tick takes in ms.

If not set, default tickTime is 100.

Generated using TypeDoc