Class RedbNodeRegistry
Node registry on redb storage ().
One record per (cluster, group, node) is guaranteed by the unique key
ValueUnique = "{cluster}:{group}:{nodeId}"; the hot paths (heartbeat) look the record up
by that key — a single probe of the unique index. Every read is scoped to this node's cluster
and group, so equal group names and node ids in different clusters of one database never meet.
Uses scoped per operation (thread-safe).
public sealed class RedbNodeRegistry : INodeRegistry
Inheritance
Implements
Methods
DeregisterAsync(CancellationToken)
Deregisters the current node (graceful shutdown).
public Task DeregisterAsync(CancellationToken ct = default)
GetAliveNodesAsync(CancellationToken)
Returns all nodes that are currently alive (heartbeat within threshold).
public Task<IReadOnlyList<RedbObject<TsakNodeProps>>> GetAliveNodesAsync(CancellationToken ct = default)
GetAllNodesAsync(CancellationToken)
Returns all registered nodes regardless of status.
public Task<IReadOnlyList<RedbObject<TsakNodeProps>>> GetAllNodesAsync(CancellationToken ct = default)
HeartbeatAsync(CancellationToken)
Updates the heartbeat timestamp for the current node.
public Task HeartbeatAsync(CancellationToken ct = default)
MarkDeadNodesAsync(CancellationToken)
Marks nodes as dead if their heartbeat exceeds the timeout threshold.
public Task<int> MarkDeadNodesAsync(CancellationToken ct = default)
RegisterAsync(CancellationToken)
Registers the current node in the cluster.
public Task RegisterAsync(CancellationToken ct = default)
RemoveNodeAsync(string, CancellationToken)
Physically removes a dead/offline node record from the registry.
public Task<bool> RemoveNodeAsync(string nodeId, CancellationToken ct = default)
SetCordonedAsync(string, bool, CancellationToken)
Sets the cordoned flag on a node (planned maintenance). A cordoned node keeps its current work
public Task<bool> SetCordonedAsync(string nodeId, bool cordoned, CancellationToken ct = default)