Skip to content

Commit a1b4f8d

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 b4669b9 commit a1b4f8d

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
@@ -730,11 +730,16 @@ func TestClosedTimestampFrozenAfterSubsumption(t *testing.T) {
730730
// Set up the closed timestamp timing such that, when we block a merge and
731731
// transfer the RHS lease, the closed timestamp advances over the LHS
732732
// lease but not over the RHS lease.
733+
//
734+
// NB: We want to ensure that the closed timestamp on the LHS is less than
735+
// the lease start time for the RHS after the lease transfer. To ensure
736+
// this holds and doesn't flake, we increase the target duration to 10
737+
// seconds.
733738
tc, _, _ := setupClusterForClosedTSTesting(ctx, t, 5*time.Second, 100*time.Millisecond, clusterArgs, "cttest", "kv")
734739
defer tc.Stopper().Stop(ctx)
735740
sqlDB := sqlutils.MakeSQLRunner(tc.ServerConn(0))
736741
sqlDB.ExecMultiple(t, strings.Split(`
737-
SET CLUSTER SETTING kv.closed_timestamp.target_duration = '5s';
742+
SET CLUSTER SETTING kv.closed_timestamp.target_duration = '10s';
738743
SET CLUSTER SETTING kv.closed_timestamp.side_transport_interval = '100ms';
739744
SET CLUSTER SETTING kv.rangefeed.closed_timestamp_refresh_interval = '100ms';
740745
SET CLUSTER SETTING kv.closed_timestamp.follower_reads.enabled = true;

0 commit comments

Comments
 (0)