Skip to content

Commit 746cd1d

Browse files
committed
kvserver: clean comments for policy_refresher.go
This commit cleans some comments up for PolicyRefresher. Release note: none Epic: none
1 parent fc46a13 commit 746cd1d

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

pkg/kv/kvserver/closedts/policyrefresher/policy_refresher.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
2929
type 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.
8383
type 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

Comments
 (0)