Skip to content

Commit

Permalink
roachpb: address review comments from cockroachdb#117840
Browse files Browse the repository at this point in the history
I had missed a `git push` immediately before merging. This updates
two comments.

Epic: None
Release note: None
  • Loading branch information
nvanbenschoten committed Jan 19, 2024
1 parent 2a4e6b8 commit 02e900d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/roachpb/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -1882,7 +1882,11 @@ func (l Lease) Speculative() bool {
//
// NB: Lease.Equivalent is NOT symmetric. For expiration-based
// leases, a lease is equivalent to another with an equal or
// later expiration, but not an earlier expiration.
// later expiration, but not an earlier expiration. Similarly,
// an expiration-based lease is equivalent to an epoch-based
// lease with the same replica and start time (representing a
// promotion from expiration-based to epoch-based), but the
// reverse is not true.
func (l Lease) Equivalent(newL Lease, expToEpochEquiv bool) bool {
// Ignore proposed timestamp & deprecated start stasis.
l.ProposedTS, newL.ProposedTS = nil, nil
Expand Down Expand Up @@ -1921,7 +1925,9 @@ func (l Lease) Equivalent(newL Lease, expToEpochEquiv bool) bool {
// Expiration-based leases carry a local expiration timestamp. Epoch-based
// leases store their expiration indirectly in NodeLiveness. We assume that
// this promotion is only proposed if the liveness expiration is later than
// previous expiration carried by the expiration-based lease.
// previous expiration carried by the expiration-based lease. This is a
// case where Equivalent is not commutative, as the reverse transition
// (from epoch-based to expiration-based) requires a sequence increment.
//
// Ignore epoch and expiration. The remaining fields which are compared
// are Replica and Start.
Expand Down

0 comments on commit 02e900d

Please sign in to comment.