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

roachtest: remove the FUSE-variants of the disk-stall roachtest #102492

Merged
merged 1 commit into from
Apr 28, 2023
Merged
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
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