Skip to content

Commit

Permalink
Merge f42be07 into blathers/backport-release-24.3-138816
Browse files Browse the repository at this point in the history
  • Loading branch information
blathers-crl[bot] authored Feb 10, 2025
2 parents d4afa75 + f42be07 commit 6bccb44
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions pkg/cmd/roachtest/tests/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/util/ctxgroup"
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
errors "github.com/cockroachdb/errors"
"github.com/cockroachdb/errors"
_ "github.com/lib/pq" // register postgres driver
"github.com/stretchr/testify/require"
)
Expand All @@ -50,8 +50,13 @@ func runNetworkAuthentication(ctx context.Context, t test.Test, c cluster.Cluste
// that they use coherent certs.
settings := install.MakeClusterSettings()

// Don't create a backup schedule as this test shuts the cluster down immediately.
c.Start(ctx, t.L(), option.NewStartOpts(option.NoBackupSchedule), settings, serverNodes)
// Don't create a backup schedule in this test as the cluster won't be up
// long and we'll inject network issues.
// We wait for replication so that we can safely restart the cluster in two
// steps next.
c.Start(
ctx, t.L(), option.NewStartOpts(option.NoBackupSchedule, option.WaitForReplication()), settings, serverNodes,
)
require.NoError(t, c.StopE(ctx, t.L(), option.DefaultStopOpts(), serverNodes))

t.L().Printf("restarting nodes...")
Expand All @@ -66,16 +71,18 @@ func runNetworkAuthentication(ctx context.Context, t test.Test, c cluster.Cluste
// Currently, creating a scheduled backup at start fails, potentially due to
// the induced network partition. Further investigation required to allow scheduled backups
// to run on this test.
startOpts := option.NewStartOpts(option.NoBackupSchedule)
startOpts.RoachprodOpts.ExtraArgs = append(startOpts.RoachprodOpts.ExtraArgs, "--locality=node=1", "--accept-sql-without-tls")
c.Start(ctx, t.L(), startOpts, settings, c.Node(1))

// See comment above about env vars.
// "--env=COCKROACH_SCAN_INTERVAL=200ms",
// "--env=COCKROACH_SCAN_MAX_IDLE_TIME=20ms",
startOpts = option.NewStartOpts(option.NoBackupSchedule)
startOpts.RoachprodOpts.ExtraArgs = append(startOpts.RoachprodOpts.ExtraArgs, "--locality=node=other", "--accept-sql-without-tls")
c.Start(ctx, t.L(), startOpts, settings, c.Range(2, n-1))
{
// We start n2+ first so that there's quorum.
startOpts := option.NewStartOpts(option.NoBackupSchedule)
startOpts.RoachprodOpts.ExtraArgs = append(startOpts.RoachprodOpts.ExtraArgs, "--locality=node=other", "--accept-sql-without-tls")
c.Start(ctx, t.L(), startOpts, settings, c.Range(2, n-1))
}
{
// Now start n1.
startOpts := option.NewStartOpts(option.NoBackupSchedule)
startOpts.RoachprodOpts.ExtraArgs = append(startOpts.RoachprodOpts.ExtraArgs, "--locality=node=1", "--accept-sql-without-tls")
c.Start(ctx, t.L(), startOpts, settings, c.Node(1))
}

t.L().Printf("retrieving server addresses...")
serverUrls, err := c.InternalPGUrl(ctx, t.L(), serverNodes, roachprod.PGURLOptions{Auth: install.AuthUserPassword})
Expand Down

0 comments on commit 6bccb44

Please sign in to comment.