From 245d4fddb407ef1560412dfc46f484efe393af8d Mon Sep 17 00:00:00 2001 From: Bilal Akhtar Date: Fri, 11 Oct 2024 15:06:06 +0000 Subject: [PATCH] roachtest: disable journalling in dmsetupDiskStaller Manual backport of #129864 to release-23.2. Fixes #132295. Fixes #132291. Release justification: Test-only change to reduce flakes. Epic: none Release note: None --- pkg/cmd/roachtest/tests/disk_stall.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/roachtest/tests/disk_stall.go b/pkg/cmd/roachtest/tests/disk_stall.go index 78db72983361..257ce2afd2ee 100644 --- a/pkg/cmd/roachtest/tests/disk_stall.go +++ b/pkg/cmd/roachtest/tests/disk_stall.go @@ -277,6 +277,8 @@ type diskStaller interface { type dmsetupDiskStaller struct { t test.Test c cluster.Cluster + + dev string // set in Setup; s.device() doesn't work when volume is not set up } var _ diskStaller = (*dmsetupDiskStaller)(nil) @@ -286,10 +288,12 @@ func (s *dmsetupDiskStaller) device(nodes option.NodeListOption) string { } func (s *dmsetupDiskStaller) Setup(ctx context.Context) { - dev := s.device(s.c.All()) + s.dev = s.device(s.c.All()) s.c.Run(ctx, s.c.All(), `sudo umount -f /mnt/data1 || true`) s.c.Run(ctx, s.c.All(), `sudo dmsetup remove_all`) - err := s.c.RunE(ctx, s.c.All(), `echo "0 $(sudo blockdev --getsz `+dev+`) linear `+dev+` 0" | `+ + // See https://github.com/cockroachdb/cockroach/issues/129619#issuecomment-2316147244. + s.c.Run(ctx, s.c.All(), `sudo tune2fs -O ^has_journal `+s.dev) + err := s.c.RunE(ctx, s.c.All(), `echo "0 $(sudo blockdev --getsz `+s.dev+`) linear `+s.dev+` 0" | `+ `sudo dmsetup create data1`) if err != nil { // This has occasionally been seen to fail with "Device or resource busy", @@ -304,6 +308,7 @@ func (s *dmsetupDiskStaller) Cleanup(ctx context.Context) { s.c.Run(ctx, s.c.All(), `sudo dmsetup resume data1`) s.c.Run(ctx, s.c.All(), `sudo umount /mnt/data1`) s.c.Run(ctx, s.c.All(), `sudo dmsetup remove_all`) + s.c.Run(ctx, s.c.All(), `sudo tune2fs -O has_journal `+s.dev) s.c.Run(ctx, s.c.All(), `sudo mount /mnt/data1`) }