Skip to content

Commit

Permalink
Merge #83352
Browse files Browse the repository at this point in the history
83352: roachtest: add new decommissionBench configurations r=AlexTalks a=AlexTalks

This change adds new configurations to the decommission benchmark test,
as well as cleaning up some existing configurations. This includes
benchmarking decommissions when we have a high number of store targets,
as well as decommissioning a node when we have just added a new node to
the cluster.

Depends on #81874, #82760.

Release note: None

Co-authored-by: Alex Sarkesian <[email protected]>
  • Loading branch information
craig[bot] and AlexTalks committed Aug 6, 2022
2 parents cc7a3e7 + c43e5d2 commit c44d567
Show file tree
Hide file tree
Showing 2 changed files with 294 additions and 48 deletions.
16 changes: 6 additions & 10 deletions pkg/cmd/roachtest/tests/decommission.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ func runDecommission(
}

if whileDown {
h.stop(ctx, node)
if err := c.StopCockroachGracefullyOnNode(ctx, t.L(), node); err != nil {
return err
}
}

run(fmt.Sprintf(`ALTER RANGE default CONFIGURE ZONE = 'constraints: {"-node%d"}'`, node))
Expand All @@ -319,7 +321,9 @@ func runDecommission(
}

if !whileDown {
h.stop(ctx, node)
if err := c.StopCockroachGracefullyOnNode(ctx, t.L(), node); err != nil {
return err
}
}

// Wipe the node and re-add to cluster with a new node ID.
Expand Down Expand Up @@ -1150,14 +1154,6 @@ func newDecommTestHelper(t test.Test, c cluster.Cluster) *decommTestHelper {
}
}

// stop gracefully stops a node with a signal.
func (h *decommTestHelper) stop(ctx context.Context, node int) {
opts := option.DefaultStopOpts()
opts.RoachprodOpts.Sig = 15 // SIGTERM
opts.RoachprodOpts.Wait = true
h.c.Stop(ctx, h.t.L(), opts, h.c.Node(node))
}

// getLogicalNodeID connects to the nodeIdx-th node in the roachprod cluster to
// obtain the logical CockroachDB nodeID of this node. This is because nodes can
// change ID as they are continuously decommissioned, wiped, and started anew.
Expand Down
Loading

0 comments on commit c44d567

Please sign in to comment.