Skip to content

Commit

Permalink
Merge #102492
Browse files Browse the repository at this point in the history
102492: roachtest: remove the FUSE-variants of the disk-stall roachtest r=nicktrav a=jbowens

These variants have proved flaky, sometimes hanging during setup or teardown. We have coverage through the cgroups and dmsetup variants.

Epic: none
Release note: none

Co-authored-by: Jackson Owens <[email protected]>
  • Loading branch information
craig[bot] and jbowens committed Apr 28, 2023
2 parents 47396a0 + af7a8b7 commit 4619767
Showing 1 changed file with 0 additions and 82 deletions.
82 changes: 0 additions & 82 deletions pkg/cmd/roachtest/tests/disk_stall.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"context"
"fmt"
"math/rand"
"runtime"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -71,33 +70,6 @@ func registerDiskStalledDetection(r registry.Registry) {
EncryptionSupport: registry.EncryptionMetamorphic,
})
}

for _, stallLogDir := range []bool{false, true} {
for _, stallDataDir := range []bool{false, true} {
// Grab copies of the args because we'll pass them into a closure.
// Everyone's favorite bug to write in Go.
stallLogDir := stallLogDir
stallDataDir := stallDataDir
r.Add(registry.TestSpec{
Name: fmt.Sprintf(
"disk-stalled/fuse/log=%t,data=%t",
stallLogDir, stallDataDir,
),
Owner: registry.OwnerStorage,
Cluster: makeSpec(),
Timeout: 30 * time.Minute,
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
runDiskStalledDetection(ctx, t, c, &fuseDiskStaller{
t: t,
c: c,
stallLogs: stallLogDir,
stallData: stallDataDir,
}, stallLogDir || stallDataDir /* doStall */)
},
EncryptionSupport: registry.EncryptionMetamorphic,
})
}
}
}

func runDiskStalledDetection(
Expand Down Expand Up @@ -404,60 +376,6 @@ func (s *cgroupDiskStaller) setThroughput(
))
}

// fuseDiskStaller uses a FUSE filesystem (charybdefs) to insert an artificial
// delay on all I/O.
type fuseDiskStaller struct {
t test.Test
c cluster.Cluster
stallLogs bool
stallData bool
}

var _ diskStaller = (*fuseDiskStaller)(nil)

func (s *fuseDiskStaller) DataDir() string {
if s.stallData {
return "{store-dir}/faulty"
}
return "{store-dir}/real"
}

func (s *fuseDiskStaller) LogDir() string {
if s.stallLogs {
return "{store-dir}/faulty/logs"
}
return "{store-dir}/real/logs"
}

func (s *fuseDiskStaller) Setup(ctx context.Context) {
if s.c.IsLocal() && runtime.GOOS != "linux" {
s.t.Fatalf("must run on linux os, found %s", runtime.GOOS)
}
s.t.Status("setting up charybdefs")
require.NoError(s.t, s.c.Install(ctx, s.t.L(), s.c.All(), "charybdefs"))
s.c.Run(ctx, s.c.All(), "sudo umount -f {store-dir}/faulty || true")
s.c.Run(ctx, s.c.All(), "mkdir -p {store-dir}/{real,faulty} || true")
s.c.Run(ctx, s.c.All(), "rm -f logs && ln -s {store-dir}/real/logs logs || true")
s.c.Run(ctx, s.c.All(), "sudo charybdefs {store-dir}/faulty -oallow_other,modules=subdir,subdir={store-dir}/real")
s.c.Run(ctx, s.c.All(), "sudo mkdir -p {store-dir}/real/logs")
s.c.Run(ctx, s.c.All(), "sudo chmod -R 777 {store-dir}/{real,faulty}")
}

func (s *fuseDiskStaller) Cleanup(ctx context.Context) {
s.c.Run(ctx, s.c.All(), "sudo umount -f {store-dir}/faulty || true")
}

func (s *fuseDiskStaller) Stall(ctx context.Context, nodes option.NodeListOption) {
// Stall for 2x the max sync duration. The tool expects an integer
// representing the delay time, in microseconds.
stallMicros := (2 * maxSyncDur).Microseconds()
s.c.Run(ctx, nodes, "charybdefs-nemesis", "--delay", strconv.FormatInt(stallMicros, 10))
}

func (s *fuseDiskStaller) Unstall(ctx context.Context, nodes option.NodeListOption) {
s.c.Run(ctx, nodes, "charybdefs-nemesis --clear")
}

func getDevice(t test.Test, s spec.ClusterSpec) string {
switch s.Cloud {
case spec.GCE:
Expand Down

0 comments on commit 4619767

Please sign in to comment.