Skip to main content

Module follower_read

Module follower_read 

Source
Expand description

Follower-read decision gate.

FollowerReadGate answers a single question: “given the session’s ReadConsistency and the local node’s role + closed timestamp for the target Raft group, can this read be served locally without forwarding to the leader?”

§Decision table

ConsistencyLocal roleClosed TS fresh?Serve locally?
Strong**Only if leader
BoundedStaleness(d)Follower≤ dYes
BoundedStaleness(d)Follower> dNo → forward
BoundedStaleness(d)Leader*Yes
Eventual**Yes

The gate is stateless — it reads from shared handles to the closed-timestamp tracker and the raft-status provider.

Structs§

FollowerReadGate
Answers “can this read be served locally?”

Enums§

ReadLevel
Consistency level for a single read — mirrors the ReadConsistency enum in the nodedb crate without coupling nodedb-cluster to it.