From 336c99798a6d7f839e06a06f44f34315d42fe7fb Mon Sep 17 00:00:00 2001 From: Jackson Owens Date: Thu, 14 Sep 2023 14:10:47 -0400 Subject: [PATCH] metamorphic: vary sstable compression algorithm In the metamorphic test runs with randomized options, vary the sstable compression algorithm rather than always using the default Snappy compression algorithm. Close #1705. --- metamorphic/options.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/metamorphic/options.go b/metamorphic/options.go index 16a5c01286..cd73289629 100644 --- a/metamorphic/options.go +++ b/metamorphic/options.go @@ -488,6 +488,15 @@ func randomOptions( default: lopts.FilterPolicy = newTestingFilterPolicy(1 << rng.Intn(5)) } + // We use either no compression, snappy compression or zstd compression. + switch rng.Intn(3) { + case 0: + lopts.Compression = pebble.NoCompression + case 1: + lopts.Compression = pebble.ZstdCompression + default: + lopts.Compression = pebble.SnappyCompression + } opts.Levels = []pebble.LevelOptions{lopts} // Explicitly disable disk-backed FS's for the random configurations. The