Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roachpb: address review comments from #117840 #117992

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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