Skip to content

Commit c90ef6e

Browse files
committed
kvserver: rename registerLeaseholder to *AndRefreshPolicy
This commit renames registerLeaseholder to registerLeaseholderAndRefreshPolicy to reflect its changes. In addition to registering the replica as a leaseholder, it now also triggers a closed timestamp policy refresh on the replica. Epic: none Release note: none
1 parent 0c60a8f commit c90ef6e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pkg/kv/kvserver/replica_proposal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ func (r *Replica) leasePostApplyLocked(
581581

582582
// Inform the store of this lease.
583583
if iAmTheLeaseHolder {
584-
r.store.registerLeaseholder(ctx, r, newLease.Sequence)
584+
r.store.registerLeaseholderAndRefreshPolicy(ctx, r, newLease.Sequence)
585585
} else {
586586
r.store.unregisterLeaseholder(ctx, r)
587587
}

pkg/kv/kvserver/store.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4147,9 +4147,10 @@ func (s *Store) WaitForSpanConfigSubscription(ctx context.Context) error {
41474147
return errors.Newf("unable to subscribe to span configs")
41484148
}
41494149

4150-
// registerLeaseholder registers the provided replica as a leaseholder in the
4151-
// node's closed timestamp side transport.
4152-
func (s *Store) registerLeaseholder(
4150+
// registerLeaseholderAndRefreshPolicy registers the provided replica as a
4151+
// leaseholder in the node's closed timestamp side transport and refreshes its
4152+
// closed timestamp policy as a post-action to the lease acquisition.
4153+
func (s *Store) registerLeaseholderAndRefreshPolicy(
41534154
ctx context.Context, r *Replica, leaseSeq roachpb.LeaseSequence,
41544155
) {
41554156
if s.ctSender != nil {

0 commit comments

Comments
 (0)