Skip to content

Commit 906797e

Browse files
committed
kv: deflake TestClosedTimestampFrozenAfterSubsumption
In the RHS lease transfer while subsumed variant, this test wants to set things up such that the LHS range's closed timestamp is lower than the RHS range's lease start time. Closing timestamps 5 seconds in the past could sometimes cause the LHS range's CTS to advance beyond the RHS's lease start time, which could cause flakes. This patch deflakes things by closing timestamps 10 seconds in the past. I stressed this a bit under deadlock and this seems promising. Closes #155517 Release note: None
1 parent 1656a4c commit 906797e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/kv/kvserver/closed_timestamp_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,11 +733,16 @@ func TestClosedTimestampFrozenAfterSubsumption(t *testing.T) {
733733
// Set up the closed timestamp timing such that, when we block a merge and
734734
// transfer the RHS lease, the closed timestamp advances over the LHS
735735
// lease but not over the RHS lease.
736+
//
737+
// NB: We want to ensure that the closed timestamp on the LHS is less than
738+
// the lease start time for the RHS after the lease transfer. To ensure
739+
// this holds and doesn't flake, we increase the target duration to 10
740+
// seconds.
736741
tc, _, _ := setupClusterForClosedTSTesting(ctx, t, 5*time.Second, 100*time.Millisecond, clusterArgs, "cttest", "kv")
737742
defer tc.Stopper().Stop(ctx)
738743
sqlDB := sqlutils.MakeSQLRunner(tc.ServerConn(0))
739744
sqlDB.ExecMultiple(t, strings.Split(`
740-
SET CLUSTER SETTING kv.closed_timestamp.target_duration = '5s';
745+
SET CLUSTER SETTING kv.closed_timestamp.target_duration = '10s';
741746
SET CLUSTER SETTING kv.closed_timestamp.side_transport_interval = '100ms';
742747
SET CLUSTER SETTING kv.rangefeed.closed_timestamp_refresh_interval = '100ms';
743748
SET CLUSTER SETTING kv.closed_timestamp.follower_reads.enabled = true;

0 commit comments

Comments
 (0)