Skip to content

Commit 8633593

Browse files
committed
metamorphic: use 12 as the minimum target file size
Before the recent compaction cleanup, the output table writer was initialized lazily, which means that until the first key was written the estimated size was 0. So even with a tiny target size, we will get at least one point key and any associated spans. Now the table writer is initialized up front and the estimated size of an empty table writer is 8. When the target file size is less than that, we try to split the table as soon as possible (and emit just a small piece of a span in many cases). These many tiny tables slow down the tests a lot, to the point of timing out certain operations. This change sets the minimum target file size in the metamorphic tests to 12. Fixes #3594 Fixes #3595
1 parent 2b26224 commit 8633593

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

metamorphic/options.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ func standardOptions() []*TestOptions {
495495
`,
496496
15: `
497497
[Level "0"]
498-
target_file_size=1
498+
target_file_size=12
499499
`,
500500
16: `
501501
[Level "0"]
@@ -706,6 +706,9 @@ func RandomOptions(
706706
lopts.BlockSizeThreshold = 50 + rng.Intn(50) // 50 - 100
707707
lopts.IndexBlockSize = 1 << uint(rng.Intn(24)) // 1 - 16MB
708708
lopts.TargetFileSize = 1 << uint(rng.Intn(28)) // 1 - 256MB
709+
// The EstimatedSize of an empty table writer is 8 bytes. We want something a
710+
// little bigger than that as the minimum target.
711+
lopts.TargetFileSize = max(lopts.TargetFileSize, 12)
709712

710713
// We either use no bloom filter, the default filter, or a filter with
711714
// randomized bits-per-key setting. We zero out the Filters map. It'll get

0 commit comments

Comments
 (0)