From c0acb6e39e09ea3396608bd10daea954c8fe40b7 Mon Sep 17 00:00:00 2001 From: Nick Cabatoff Date: Wed, 17 May 2023 13:20:04 -0400 Subject: [PATCH 1/2] Make -dev-three-node use perf standbys for ent binaries --- command/server.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/command/server.go b/command/server.go index e75415241423..1eccb3b5e878 100644 --- a/command/server.go +++ b/command/server.go @@ -43,6 +43,7 @@ import ( loghelper "github.com/hashicorp/vault/helper/logging" "github.com/hashicorp/vault/helper/metricsutil" "github.com/hashicorp/vault/helper/namespace" + "github.com/hashicorp/vault/helper/testhelpers/teststorage" "github.com/hashicorp/vault/helper/useragent" vaulthttp "github.com/hashicorp/vault/http" "github.com/hashicorp/vault/internalshared/configutil" @@ -1999,7 +2000,7 @@ func (c *ServerCommand) enableDev(core *vault.Core, coreConfig *vault.CoreConfig } func (c *ServerCommand) enableThreeNodeDevCluster(base *vault.CoreConfig, info map[string]string, infoKeys []string, devListenAddress, tempDir string) int { - testCluster := vault.NewTestCluster(&testing.RuntimeT{}, base, &vault.TestClusterOptions{ + conf, opts := teststorage.ClusterSetup(base, &vault.TestClusterOptions{ HandlerFunc: vaulthttp.Handler, BaseListenAddress: c.flagDevListenAddr, Logger: c.logger, @@ -2014,9 +2015,18 @@ func (c *ServerCommand) enableThreeNodeDevCluster(base *vault.CoreConfig, info m }, }, }, - }) + }, nil) + testCluster := vault.NewTestCluster(&testing.RuntimeT{}, conf, opts) defer c.cleanupGuard.Do(testCluster.Cleanup) + if constants.IsEnterprise { + err := testcluster.WaitForActiveNodeAndPerfStandbys(context.Background(), testCluster) + if err != nil { + c.UI.Error(fmt.Sprintf("perf standbys didn't become ready: %v", err)) + return 1 + } + } + info["cluster parameters path"] = testCluster.TempDir infoKeys = append(infoKeys, "cluster parameters path") From 5141c52e6a08a291f023b4e816ea9af2652de1ac Mon Sep 17 00:00:00 2001 From: Nick Cabatoff Date: Wed, 17 May 2023 14:08:22 -0400 Subject: [PATCH 2/2] Add CL --- changelog/20629.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog/20629.txt diff --git a/changelog/20629.txt b/changelog/20629.txt new file mode 100644 index 000000000000..f5692f7691e0 --- /dev/null +++ b/changelog/20629.txt @@ -0,0 +1,3 @@ +```release-note:improvement +command/server (enterprise): -dev-three-node now creates perf standbys instead of regular standbys. +``` \ No newline at end of file