Skip to content

Commit

Permalink
Merge pull request #78116 from cockroachdb/blathers/backport-release-…
Browse files Browse the repository at this point in the history
…22.1-77867

release-22.1: roachtest: update node death expectations in disk-full test
  • Loading branch information
nicktrav authored Mar 21, 2022
2 parents eb69e18 + db183ce commit 8285d6c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/cmd/roachtest/tests/disk_full.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ func registerDiskFull(r registry.Registry) {
}

nodes := c.Spec().NodeCount - 1
c.Put(ctx, t.Cockroach(), "./cockroach", c.Range(1, nodes))
c.Put(ctx, t.DeprecatedWorkload(), "./workload", c.Node(nodes+1))
c.Put(ctx, t.Cockroach(), "./cockroach", c.Range(1, c.Spec().NodeCount))
c.Start(ctx, t.L(), option.DefaultStartOpts(), install.MakeClusterSettings(), c.Range(1, nodes))

t.Status("running workload")
m := c.NewMonitor(ctx, c.Range(1, nodes))
m.Go(func(ctx context.Context) error {
cmd := fmt.Sprintf(
"./workload run kv --tolerate-errors --init --read-percent=0"+
"./cockroach workload run kv --tolerate-errors --init --read-percent=0"+
" --concurrency=10 --duration=4m {pgurl:2-%d}",
nodes)
c.Run(ctx, c.Node(nodes+1), cmd)
Expand Down Expand Up @@ -118,13 +117,16 @@ func registerDiskFull(r registry.Registry) {

// Clear the emergency ballast. Clearing the ballast
// should allow the node to start, perform compactions,
// etc.
// etc. Allow a death here as the monitor may detect the
// node is still dead until the node has had its ballast
// file removed and has been successfully restarted.
t.L().Printf("removing the emergency ballast on n%d\n", n)
m.ResetDeaths()
m.ExpectDeath()
c.Run(ctx, c.Node(n), "rm -f {store-dir}/auxiliary/EMERGENCY_BALLAST")
if err := c.StartE(ctx, t.L(), option.DefaultStartOpts(), install.MakeClusterSettings(), c.Node(n)); err != nil {
t.Fatal(err)
}
m.ResetDeaths()

// Wait a little while and delete the large file we
// added to induce the out-of-disk condition.
Expand Down

0 comments on commit 8285d6c

Please sign in to comment.