Skip to content

Commit

Permalink
storage: remove redundant calls to UpdateObservedTimestamp
Browse files Browse the repository at this point in the history
85d4627 added a new update to a transaction's observed timestamps.
This update to the observed timestamps made the other two in the
deferred function immediately above it redundant.

This commit removes those redundant updates and removes the proto
clones we were performing to permit those updates.

Release note: None
  • Loading branch information
nvanbenschoten committed Mar 14, 2019
1 parent 734c43f commit d13ecaf
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions pkg/storage/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -2795,18 +2795,13 @@ func (s *Store) Send(
// this node.
if pErr != nil {
pErr.OriginNode = ba.Replica.NodeID
if txn := pErr.GetTxn(); txn != nil {
// Clone the txn, as we'll modify it.
pErr.SetTxn(txn)
} else {
if txn := pErr.GetTxn(); txn == nil {
pErr.SetTxn(ba.Txn)
}
pErr.GetTxn().UpdateObservedTimestamp(ba.Replica.NodeID, now)
} else {
if br.Txn == nil {
br.Txn = ba.Txn
}
br.Txn.UpdateObservedTimestamp(ba.Replica.NodeID, now)
// Update our clock with the outgoing response txn timestamp
// (if timestamp has been forwarded).
if ba.Timestamp.Less(br.Txn.Timestamp) {
Expand Down

0 comments on commit d13ecaf

Please sign in to comment.