@@ -20,12 +20,12 @@ import (
2020)
2121
2222// PolicyRefresher periodically refreshes the closed timestamp policies for
23- // leaseholder replicas based on network latencies between leaseholders and
24- // their furthest follower .
23+ // ranges that have leaseholders on the node on which it is running or when
24+ // there are on-demand refresh requests from the replica .
2525//
26- // For ranges configured to serve global reads, this determines how far into the
27- // future timestamps should be closed based on the latency to the farthest
28- // follower (if LeadForGlobalReadsAutoTuneEnabled is enabled) .
26+ // When LeadForGlobalReadsAutoTuneEnabled is enabled, ranges configured with
27+ // global reads consider network latencies between the leaseholder and its
28+ // furthest follower when calculating closed timestamps .
2929type PolicyRefresher struct {
3030 stopper * stop.Stopper
3131 settings * cluster.Settings
@@ -79,11 +79,13 @@ func NewPolicyRefresher(
7979 return refresher
8080}
8181
82- // Replica is implemented by kvserver.Replica .
82+ // Replica defines a thin interface to update closed timestamp policies .
8383type Replica interface {
84- // RefreshPolicy is called to update closed timestamp policy periodically
85- // with observed latency information by PolichRefresher. Note that the
86- // given map here can be nil.
84+ // RefreshPolicy informs the replica that it should refresh its closed
85+ // timestamp policy. A latency map, which includes observed latency to other
86+ // nodes in the system by the PolicyRefresher may be supplied (or may be nil),
87+ // in which case it may be used to correctly place a replica in its latency
88+ // based global reads bucket.
8789 RefreshPolicy (map [roachpb.NodeID ]time.Duration )
8890}
8991
0 commit comments