ShardCoordinatorOptionsType
ShardCoordinatorOptionsType =
object
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:24
Plain options-object shape consumed by a ShardCoordinator.
Properties
Section titled “Properties”acquireRetryIntervalMs?
Section titled “acquireRetryIntervalMs?”
readonlyoptionalacquireRetryIntervalMs?:number
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:60
Retry interval for lease.acquire() after a failed attempt. Default: 5 s.
allocationStrategy
Section titled “allocationStrategy”
readonlyallocationStrategy:AllocationStrategy
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:27
cluster
Section titled “cluster”
readonlycluster:Cluster
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:26
coordinatorStateStore?
Section titled “coordinatorStateStore?”
readonlyoptionalcoordinatorStateStore?:CoordinatorStateStore
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:89
Optional persistence backend for the allocation state itself
(regions + shardHome). Without it, LeaderChanged triggers
a full rebuild from Register gossip — fine for a few hundred
shards, painful at thousands. With it, the new leader loads
the last-known snapshot from the store (e.g. DistributedData)
and skips the reallocation storm.
ClusterSharding does NOT auto-instantiate this — the user
must explicitly start a DistributedData extension first and
pass new DistributedDataCoordinatorStateStore(...). Without
that opt-in, ShardCoordinator keeps the v1 rebuild-from-
Register behaviour (backwards-compat).
handOffTimeoutMs?
Section titled “handOffTimeoutMs?”
readonlyoptionalhandOffTimeoutMs?:number
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:42
lease?
Section titled “lease?”
readonlyoptionallease?:Lease
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:58
Optional split-brain protection. When set, the elected leader’s
coordinator must hold the lease before it processes shard
messages. Under a network partition where two nodes converge to
“I am the leader” gossip views, only the side that successfully
acquires the lease ever issues AllocateShard / HandOff
directives — the other side stays passive and drops messages
(regions retry naturally on their next cache miss).
Without a lease the coordinator gates only on isLeader() —
v1 behaviour, no extra coordination.
localResolver
Section titled “localResolver”
readonlylocalResolver: (path) =>ActorRef|null
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:45
Resolver for local actor paths — used when coordinator lives on the same node as a region.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”ActorRef | null
numShards
Section titled “numShards”
readonlynumShards:number
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:39
Number of shards for this entity type — the bound the coordinator checks
an incoming GetShardHome against.
A shard id is hash(entityId) % numShards, so no honest region can ever
ask for one outside 0 .. numShards - 1. Without the bound the
coordinator allocated, recorded and persisted whatever id it was asked
for, and the allocation map is durable state that is replayed at every
coordinator start — so a peer could grow it without limit and the growth
survived restarts (#583).
rebalanceIntervalMs?
Section titled “rebalanceIntervalMs?”
readonlyoptionalrebalanceIntervalMs?:number
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:41
rememberEntities?
Section titled “rememberEntities?”
readonlyoptionalrememberEntities?:boolean
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:43
rememberEntitiesStore?
Section titled “rememberEntitiesStore?”
readonlyoptionalrememberEntitiesStore?:RememberEntitiesStore
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:74
Optional persistence backend for the entity registry. Only used
when rememberEntities: true. Without it, entitiesPerShard
stays in-memory only and a full cluster restart loses the
registry — until messages re-arrive and trigger fresh
EntityStarted notifications. Set to a JournalRememberEntitiesStore
(or any custom impl) to make the registry survive cold-starts.
The ClusterSharding extension auto-instantiates the default
JournalRememberEntitiesStore (using the active Journal) when
rememberEntities: true and no explicit store is provided —
so most users don’t need to touch this field.
readonlyoptionalrole?:string
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:40
typeName
Section titled “typeName”
readonlytypeName:string
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:25
