Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roachtest: fix network/authentication/nodes=4 #138816

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading