Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
128696: roachtest: backup-restore/mixed-version support for shared-process r=DarrylWong a=renatolabs

This commit updates the `backup-restore/mixed-version` test in order to enable shared-process deployments. The main differences are:

* changing the `CommonTestUtils` struct so that it is able to connect to the system tenant and the application tenant.
* disabling cluster backups in multi-tenant deployments. Disaster Recovery can add support for that if necessary.

Informs: cockroachdb#127378

Release note: None

128931: lease: deflake TestLeaseAtLatestVersion r=rafiss a=rafiss

Change to a less strict condition for generating an error.

fixes cockroachdb#128701
Release note: None

Co-authored-by: Renato Costa <[email protected]>
Co-authored-by: Rafi Shamim <[email protected]>
  • Loading branch information
3 people committed Aug 14, 2024
3 parents b903b22 + ce38cdb + 51a7038 commit 739cc7d
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 54 deletions.
22 changes: 17 additions & 5 deletions pkg/cmd/roachtest/tests/backup_restore_roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package tests
import (
"context"
gosql "database/sql"
"fmt"
"math/rand"
"time"

Expand All @@ -34,11 +35,11 @@ var (
// sizes that may get set for all user databases.
maxRangeSizeBytes = []int64{4 << 20 /* 4 MiB*/, 32 << 20 /* 32 MiB */, 128 << 20}

// SystemSettingsValuesBoundOnRangeSize defines the cluster settings that
// clusterSettingsValuesBoundOnRangeSize defines the cluster settings that
// should scale in proportion to the range size. For example, if the range
// size is halved, all the values of these cluster settings should also be
// halved.
systemSettingsScaledOnRangeSize = []string{
clusterSettingsScaledOnRangeSize = []string{
"backup.restore_span.target_size",
"bulkio.backup.file_size",
"kv.bulk_sst.target_size",
Expand Down Expand Up @@ -116,7 +117,15 @@ func backupRestoreRoundTrip(
m := c.NewMonitor(ctx, c.CRDBNodes())

m.Go(func(ctx context.Context) error {
testUtils, err := newCommonTestUtils(ctx, t, c, c.CRDBNodes(), sp.mock, sp.onlineRestore)
connectFunc := func(node int) (*gosql.DB, error) {
conn, err := c.ConnE(ctx, t.L(), node)
if err != nil {
return nil, fmt.Errorf("failed to connect to node %d: %w", node, err)
}

return conn, err
}
testUtils, err := newCommonTestUtils(ctx, t, c, connectFunc, c.CRDBNodes(), sp.mock, sp.onlineRestore)
if err != nil {
return err
}
Expand All @@ -138,7 +147,7 @@ func backupRestoreRoundTrip(
if err := testUtils.setShortJobIntervals(ctx, testRNG); err != nil {
return err
}
if err := testUtils.setClusterSettings(ctx, t.L(), testRNG); err != nil {
if err := testUtils.setClusterSettings(ctx, t.L(), c, testRNG); err != nil {
return err
}
if sp.metamorphicRangeSize {
Expand All @@ -162,7 +171,10 @@ func backupRestoreRoundTrip(

// Run backups.
t.L().Printf("starting backup %d", i+1)
collection, err := d.createBackupCollection(ctx, t.L(), testRNG, bspec, bspec, "round-trip-test-backup", true)
collection, err := d.createBackupCollection(
ctx, t.L(), testRNG, bspec, bspec, "round-trip-test-backup",
true /* internalSystemsJobs */, false, /* isMultitenant */
)
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit 739cc7d

Please sign in to comment.