From 38fd0572879ccbbaf6ce95235b6d5932b4cc8441 Mon Sep 17 00:00:00 2001 From: Aditya Maru Date: Fri, 25 Mar 2022 14:53:38 +0530 Subject: [PATCH] backupccl: set shorter closed_timestamp settings in datadriven tests This change drops the `kv.closed_timestamp.side_transport_interval` and `kv.closed_timestamp.target_duration` in the servers started as part of the datadriven framework. This change was motivated by the fact that cluster settings set in certain multi-node datadriven tests were not being observed by all nodes in the cluster. Cluster settings are now backed by rangefeeds instead of gossiping the SystemSpanConfig and so these settings should speed up when all nodes become aware of changes to their values. Fixes: #77264 Release note: None --- pkg/ccl/backupccl/BUILD.bazel | 1 + pkg/ccl/backupccl/backup_test.go | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pkg/ccl/backupccl/BUILD.bazel b/pkg/ccl/backupccl/BUILD.bazel index 304cf3922b6c..d55732fa9319 100644 --- a/pkg/ccl/backupccl/BUILD.bazel +++ b/pkg/ccl/backupccl/BUILD.bazel @@ -208,6 +208,7 @@ go_test( "//pkg/kv/bulk", "//pkg/kv/kvclient/kvcoord", "//pkg/kv/kvserver", + "//pkg/kv/kvserver/closedts", "//pkg/kv/kvserver/kvserverbase", "//pkg/kv/kvserver/protectedts", "//pkg/kv/kvserver/protectedts/ptpb", diff --git a/pkg/ccl/backupccl/backup_test.go b/pkg/ccl/backupccl/backup_test.go index f6e323626173..74ac906cf297 100644 --- a/pkg/ccl/backupccl/backup_test.go +++ b/pkg/ccl/backupccl/backup_test.go @@ -52,6 +52,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/kv" "github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord" "github.com/cockroachdb/cockroach/pkg/kv/kvserver" + "github.com/cockroachdb/cockroach/pkg/kv/kvserver/closedts" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/protectedts" "github.com/cockroachdb/cockroach/pkg/roachpb" "github.com/cockroachdb/cockroach/pkg/security" @@ -172,16 +173,23 @@ func (d *datadrivenTestState) addServer( var cleanup func() params := base.TestClusterArgs{} params.ServerArgs.ExternalIODirConfig = ioConf + params.ServerArgs.Knobs = base.TestingKnobs{ + JobsTestingKnobs: jobs.NewTestingKnobsWithShortIntervals(), + } + + settings := cluster.MakeTestingClusterSettings() + closedts.TargetDuration.Override(context.Background(), &settings.SV, 10*time.Millisecond) + closedts.SideTransportCloseInterval.Override(context.Background(), &settings.SV, 10*time.Millisecond) + if tempCleanupFrequency != "" { duration, err := time.ParseDuration(tempCleanupFrequency) if err != nil { return errors.New("unable to parse tempCleanupFrequency during server creation") } - settings := cluster.MakeTestingClusterSettings() sql.TempObjectCleanupInterval.Override(context.Background(), &settings.SV, duration) sql.TempObjectWaitInterval.Override(context.Background(), &settings.SV, time.Millisecond) - params.ServerArgs.Settings = settings } + params.ServerArgs.Settings = settings clusterSize := singleNode