Skip to content

Commit

Permalink
kv: set txn MinTimestamp in SetFixedTimestamp
Browse files Browse the repository at this point in the history
This was causing tests to stall because a transaction's MinTimestamp
could end up being above its commit timestamp.

Release note: None
  • Loading branch information
nvanbenschoten committed Nov 15, 2019
1 parent 7df3b6f commit a2fa1d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/internal/client/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ func (m *MockTransactionalSender) CommitTimestampFixed() bool {
func (m *MockTransactionalSender) SetFixedTimestamp(_ context.Context, ts hlc.Timestamp) {
m.txn.Timestamp = ts
m.txn.OrigTimestamp = ts
m.txn.MinTimestamp = ts
m.txn.MaxTimestamp = ts
m.txn.OrigTimestampWasObserved = true
}
Expand Down
1 change: 1 addition & 0 deletions pkg/kv/txn_coord_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,7 @@ func (tc *TxnCoordSender) SetFixedTimestamp(ctx context.Context, ts hlc.Timestam
tc.mu.Lock()
tc.mu.txn.Timestamp = ts
tc.mu.txn.OrigTimestamp = ts
tc.mu.txn.MinTimestamp = ts
tc.mu.txn.MaxTimestamp = ts
tc.mu.txn.OrigTimestampWasObserved = true
tc.mu.Unlock()
Expand Down

0 comments on commit a2fa1d1

Please sign in to comment.