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

Make -dev-three-node use perf standbys for ent binaries #20629

Merged
merged 2 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions changelog/20629.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
command/server (enterprise): -dev-three-node now creates perf standbys instead of regular standbys.
```
14 changes: 12 additions & 2 deletions command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand All @@ -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")

Expand Down