Skip to content

Commit

Permalink
internal/metamorphic: use at least FormatRangeKeys
Browse files Browse the repository at this point in the history
Now that range keys are gated behind a format major version and the metamorphic
tests write range keys, we must use at least FormatRangeKeys in the metamorphic
tests.

Fix merge skew from #1497 and #1503.
  • Loading branch information
jbowens committed Feb 14, 2022
1 parent b1af263 commit 6af77d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/metamorphic/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ func randomOptions(rng *rand.Rand) *testOptions {
opts.Cache = cache.New(1 << uint(rng.Intn(30))) // 1B - 1GB
opts.DisableWAL = rng.Intn(2) == 0
opts.FlushSplitBytes = 1 << rng.Intn(20) // 1B - 1MB
// The metamorphic test exercises the latest SingleDelete semantics, that
// require SetWithDelete so we cannot use an older FormatMajorVersion.
opts.FormatMajorVersion = pebble.FormatSetWithDelete
n := int(pebble.FormatNewest - pebble.FormatSetWithDelete)
// The metamorphic test exercise range keys, so so we cannot use an older
// FormatMajorVersion than pebble.FormatRangeKeys.
opts.FormatMajorVersion = pebble.FormatRangeKeys
n := int(pebble.FormatNewest - opts.FormatMajorVersion)
if n > 0 {
opts.FormatMajorVersion += pebble.FormatMajorVersion(rng.Intn(n))
}
Expand Down

0 comments on commit 6af77d5

Please sign in to comment.