Skip to content

Commit

Permalink
backupccl: set shorter closed_timestamp settings in datadriven tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
adityamaru committed Mar 27, 2022
1 parent 834eaa0 commit 38fd057
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/ccl/backupccl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 10 additions & 2 deletions pkg/ccl/backupccl/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 38fd057

Please sign in to comment.