Skip to content

Commit

Permalink
kv: remove clock update on BatchResponse
Browse files Browse the repository at this point in the history
Before this change, we were updating the local clock with each BatchResponse's
WriteTimestamp. This was meant to handle cases where the batch request timestamp
was forwarded during evaluation.

This was unnecessary for two reasons. The first is that BatchRequest can lead
the local HLC clock (explored in #72121 and #72278) as long as any clock reading
information in the values reflects the state of the HLC clock (synthetic bit
today, "local timestamp" tomorrow). The second is that even if this first reason
was not the case, the BatchRequest will only ever be bumped one logical tick
above any existing value in the range, so as long as the existing values in the
range followed the rule of trailing the leaseholders HLC (NB: they don't), all
new writes would too.
  • Loading branch information
nvanbenschoten committed Feb 8, 2022
1 parent 03c50b0 commit b9ee582
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions pkg/kv/kvserver/store_send.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,6 @@ func (s *Store) Send(
if br.Txn == nil {
br.Txn = ba.Txn
}
// Update our clock with the outgoing response txn timestamp
// (if timestamp has been forwarded).
if ba.Timestamp.Less(br.Txn.WriteTimestamp) {
if clockTS, ok := br.Txn.WriteTimestamp.TryToClockTimestamp(); ok {
s.cfg.Clock.Update(clockTS)
}
}
}
} else {
if pErr == nil {
// Update our clock with the outgoing response timestamp.
// (if timestamp has been forwarded).
if ba.Timestamp.Less(br.Timestamp) {
if clockTS, ok := br.Timestamp.TryToClockTimestamp(); ok {
s.cfg.Clock.Update(clockTS)
}
}
}
}

Expand Down

0 comments on commit b9ee582

Please sign in to comment.