Skip to content

Commit

Permalink
Merge pull request #135741 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-23.1-132451

release-23.1: roachtest: disable journalling in dmsetupDiskStaller
  • Loading branch information
itsbilal authored Nov 20, 2024
2 parents b2a410f + 245d4fd commit 7559ece
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/cmd/roachtest/tests/disk_stall.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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",
Expand All @@ -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`)
}

Expand Down

0 comments on commit 7559ece

Please sign in to comment.