Skip to content

Commit

Permalink
storage: make maxItersBeforeSeek metamorphic
Browse files Browse the repository at this point in the history
To prevent maxItersBeforeSeek from hidding inconsistencies between seeking and
iterating in the future, the commit makes the value metamorphic, with a range of
[0,3). Going forward, unit tests will use different values for this heuristic.

Release justification: None. Not intended for v22.1.
  • Loading branch information
nvanbenschoten committed Mar 23, 2022
1 parent cde2974 commit 55ef09a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/storage/pebble_mvcc_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,22 @@ import (
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/uncertainty"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/storage/enginepb"
"github.com/cockroachdb/cockroach/pkg/util"
"github.com/cockroachdb/cockroach/pkg/util/hlc"
"github.com/cockroachdb/cockroach/pkg/util/mon"
"github.com/cockroachdb/cockroach/pkg/util/protoutil"
"github.com/cockroachdb/errors"
"github.com/cockroachdb/pebble"
)

const (
maxItersBeforeSeek = 0
// Key value lengths take up 8 bytes (2 x Uint32).
const kvLenSize = 8

// Key value lengths take up 8 bytes (2 x Uint32).
kvLenSize = 8
var maxItersBeforeSeek = util.ConstantWithMetamorphicTestRange(
"mvcc-max-iters-before-seek",
10, /* defaultValue */
0, /* min */
3, /* max */
)

// Struct to store MVCCScan / MVCCGet in the same binary format as that
Expand Down

0 comments on commit 55ef09a

Please sign in to comment.