github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/kv/kvserver/kvserverbase/knobs.go (about)

     1  // Copyright 2018 The Cockroach Authors.
     2  //
     3  // Use of this software is governed by the Business Source License
     4  // included in the file licenses/BSL.txt.
     5  //
     6  // As of the Change Date specified in that file, in accordance with
     7  // the Business Source License, use of this software will be governed
     8  // by the Apache License, Version 2.0, included in the file
     9  // licenses/APL.txt.
    10  
    11  // Package workload provides an abstraction for generators of sql query loads
    12  // (and requisite initial data) as well as tools for working with these
    13  // generators.
    14  
    15  package kvserverbase
    16  
    17  // BatchEvalTestingKnobs contains testing helpers that are used during batch evaluation.
    18  type BatchEvalTestingKnobs struct {
    19  	// TestingEvalFilter is called before evaluating each command. This filter is
    20  	// deprecated in favor of either TestingProposalFilter (which runs only on the
    21  	// lease holder) or TestingApplyFilter (which runs on each replica). If your
    22  	// filter is not idempotent, consider wrapping it in a
    23  	// ReplayProtectionFilterWrapper.
    24  	// TODO(bdarnell,tschottdorf): Migrate existing tests which use this
    25  	// to one of the other filters. See #10493
    26  	// TODO(andrei): Provide guidance on what to use instead for trapping reads.
    27  	TestingEvalFilter ReplicaCommandFilter
    28  
    29  	// NumKeysEvaluatedForRangeIntentResolution is set by the stores to the
    30  	// number of keys evaluated for range intent resolution.
    31  	NumKeysEvaluatedForRangeIntentResolution *int64
    32  
    33  	// RecoverIndeterminateCommitsOnFailedPushes will propagate indeterminate
    34  	// commit errors to trigger transaction recovery even if the push that
    35  	// discovered the indeterminate commit was going to fail. This increases
    36  	// the chance that conflicting transactions will prevent parallel commit
    37  	// attempts from succeeding.
    38  	RecoverIndeterminateCommitsOnFailedPushes bool
    39  }
    40  
    41  // IntentResolverTestingKnobs contains testing helpers that are used during
    42  // intent resolution.
    43  type IntentResolverTestingKnobs struct {
    44  	// DisableAsyncIntentResolution disables the async intent resolution
    45  	// path (but leaves synchronous resolution). This can avoid some
    46  	// edge cases in tests that start and stop servers.
    47  	DisableAsyncIntentResolution bool
    48  
    49  	// ForceSyncIntentResolution forces all asynchronous intent resolution to be
    50  	// performed synchronously. It is equivalent to setting IntentResolverTaskLimit
    51  	// to -1.
    52  	ForceSyncIntentResolution bool
    53  
    54  	// MaxGCBatchSize overrides the maximum number of transaction record gc
    55  	// requests which can be sent in a single batch.
    56  	MaxGCBatchSize int
    57  
    58  	// MaxIntentResolutionBatchSize overrides the maximum number of intent
    59  	// resolution requests which can be sent in a single batch.
    60  	MaxIntentResolutionBatchSize int
    61  }