Skip to content

Commit

Permalink
kvserver: log txn and write ts in a test
Browse files Browse the repository at this point in the history
Otherwise, there's little to investigate should
the assertions below fail.

See #130786.

Closes #130786.

Release note: None
Epic: None
  • Loading branch information
tbg committed Sep 16, 2024
1 parent 58f50a3 commit 91575d6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/kv/kvserver/client_replica_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,9 +862,14 @@ func TestTxnReadWithinUncertaintyIntervalAfterLeaseTransfer(t *testing.T) {
// The transaction has a read timestamp beneath the write's commit timestamp
// but a global uncertainty limit above the write's commit timestamp. The
// observed timestamp collected is also beneath the write's commit timestamp.
require.True(t, txn.ReadTimestamp.Less(writeTs))
require.True(t, writeTs.Less(txn.GlobalUncertaintyLimit))
require.True(t, txn.ObservedTimestamps[0].Timestamp.ToTimestamp().Less(writeTs))
assert.True(t, txn.ReadTimestamp.Less(writeTs))
assert.True(t, writeTs.Less(txn.GlobalUncertaintyLimit))
assert.True(t, txn.ObservedTimestamps[0].Timestamp.ToTimestamp().Less(writeTs))

if t.Failed() {
t.Logf("writeTs=%s, txn=%+v", writeTs, txn)
t.FailNow()
}

// Add a replica for key A's range to node 2. Transfer the lease.
tc.AddVotersOrFatal(t, keyA, tc.Target(1))
Expand Down

0 comments on commit 91575d6

Please sign in to comment.