ClusterOptions

class ClusterOptions @InternalWowApi constructor(val leaseTtl: Duration = 10.seconds, val renewInterval: Duration = 3.seconds, val memberTtl: Duration = 10.seconds, val heartbeatInterval: Duration = 3.seconds, val reconcileInterval: Duration = 1.seconds, val routeRefreshInterval: Duration = 1.seconds, val forwardTimeout: Duration = WaitPlan.DEFAULT_TIMEOUT, val maxInFlightPerPeer: Int, val drainTimeout: Duration = 10.seconds, val leaseParallelism: Int = 16, val reconcileTimeout: Duration = 1.minutes)

The tuning of partition ownership and the cluster channel on one node (–).

  • leaseTtl, renewed every renewInterval: how long a partition stays with a node that stopped renewing. A renewal round renews the held leases with one call, and acquisitions run at most leaseParallelism at a time: a round must stay well inside leaseTtl − renewInterval. A lease left unrenewed that long is taken as lost, so renewInterval is less than half of leaseTtl: otherwise every lease would be lost between two rounds.

  • memberTtl, refreshed every heartbeatInterval: how long a node stays a member after its last heartbeat. heartbeatInterval is less than half of memberTtl, so a heartbeat late by up to another interval keeps the node a member.

  • reconcileInterval: how often a node compares the partitions it holds with its HRW target; a change of the members it notices reconciles at once.

  • routeRefreshInterval: how often the route table is read from the leases and members; a failed forward refreshes it at once.

  • forwardTimeout: how long a forward waits for the owner's reply, capped by the command's own deadline; a forward sent and not answered by then is reported unknown, not run locally. Only a forward the owner surely did not receive runs locally. Since a timeout no longer runs the command elsewhere, waiting less than the command would only fail it sooner: the default is the default wait (WaitPlan.DEFAULT_TIMEOUT, 10 seconds), not the 1 second of earlier releases, which covered the owner's tail before falling back.

  • maxInFlightPerPeer: the forwards one peer may have outstanding; one more runs locally instead.

  • drainTimeout: how long a hand-off waits for the partition's commands in flight before it moves on.

  • reconcileTimeout: how long one reconcile may run before the node takes itself as stuck: it stops heartbeating and leaves the members until the reconcile ends, so the others take the partitions it cannot run. Well above what a hand-off takes: the drain, then the stop of each runtime; longer than drainTimeout at least.

Fields may be added: Wow builds it from the host's configuration, so the constructor is internal to Wow.

Constructors

Link copied to clipboard
constructor(leaseTtl: Duration = 10.seconds, renewInterval: Duration = 3.seconds, memberTtl: Duration = 10.seconds, heartbeatInterval: Duration = 3.seconds, reconcileInterval: Duration = 1.seconds, routeRefreshInterval: Duration = 1.seconds, forwardTimeout: Duration = WaitPlan.DEFAULT_TIMEOUT, maxInFlightPerPeer: Int, drainTimeout: Duration = 10.seconds, leaseParallelism: Int = 16, reconcileTimeout: Duration = 1.minutes)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String