Documentation
¶
Overview ¶
Package replication implements the Replica-side Follow stream client. A Replica connects to the Primary, receives PrimaryMessages (records, commits, and compaction updates), persists records locally, and sends Receipts with embedded Heartbeats back to the Primary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Follower ¶
type Follower struct {
// contains filtered or unexported fields
}
Follower connects to the Primary's Follow RPC as a Replica, receives PrimaryMessages, persists records locally, and sends Receipts.
func NewFollower ¶
func NewFollower( logger *slog.Logger, nodeID string, state *nodestate.State, peers *peerclient.Manager, db localdb.Database, heartbeatSender *heartbeat.Sender, watchManager *watch.Manager, replicaMetrics *Metrics, compactionMetrics *metrics.CompactionMetrics, retryMetrics *metrics.RetryMetrics, ) *Follower
NewFollower creates a new replication Follower.
func (*Follower) RequireInitialSync ¶
func (f *Follower) RequireInitialSync()
RequireInitialSync marks the next Start call as a bootstrap start that must not return until the follower has either received the Primary's Initial message or determined that no remote Primary follow stream is needed.
func (*Follower) SetMetrics ¶
SetMetrics sets the Replica-scoped metrics reference.
type Metrics ¶
type Metrics struct {
ReceiptAge *receiptAgeGauge
}
Metrics holds Replica-scoped replication Prometheus metrics.
func (*Metrics) Collectors ¶
func (m *Metrics) Collectors() []prometheus.Collector
Collectors returns all Replica-scoped collectors for registration with a RoleGroup.