Documentation
¶
Index ¶
- func CheckEndTxnTrigger(args kvserverbase.FilterArgs) *roachpb.Error
- func CheckKeyCount(t *testing.T, kvDB *kv.DB, span roachpb.Span, numKeys int)
- func CheckKeyCountE(t *testing.T, kvDB *kv.DB, span roachpb.Span, numKeys int) error
- func CreateKVTable(sqlDB *gosql.DB, name string, numRows int) error
- func CreateTestTenantParams(tenantID roachpb.TenantID) base.TestTenantArgs
- func CreateTestingKnobs() base.TestingKnobs
- type CommandFilters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckEndTxnTrigger ¶
func CheckEndTxnTrigger(args kvserverbase.FilterArgs) *roachpb.Error
CheckEndTxnTrigger verifies that an EndTxnRequest that includes intents for the SystemDB keys sets the proper trigger.
TODO(ajwerner): Remove this in 22.2. It only applies to the mixed-version state.
func CheckKeyCount ¶
CheckKeyCount checks that the number of keys in the provided span matches numKeys.
func CheckKeyCountE ¶
CheckKeyCountE returns an error if the the number of keys in the provided span does not match numKeys.
func CreateKVTable ¶
CreateKVTable creates a basic table named t.<name> that stores key/value pairs with numRows of arbitrary data.
func CreateTestTenantParams ¶
func CreateTestTenantParams(tenantID roachpb.TenantID) base.TestTenantArgs
CreateTestTenantParams creates a set of params suitable for SQL Tenant Tests.
func CreateTestingKnobs ¶
func CreateTestingKnobs() base.TestingKnobs
CreateTestingKnobs creates a testing knob in the unit tests.
Types ¶
type CommandFilters ¶
CommandFilters provides facilities for registering "TestingCommandFilters" (i.e. functions to be run on every replica command). CommandFilters is thread-safe. CommandFilters also optionally does replay protection if filters need it.
func CreateTestServerParams ¶
func CreateTestServerParams() (base.TestServerArgs, *CommandFilters)
CreateTestServerParams creates a set of params suitable for SQL tests. It enables some EndTxn sanity checking and installs a flexible TestingEvalFilter. TODO(andrei): this function is not used consistently by SQL tests. Figure out if the EndTxn checks are important.
func (*CommandFilters) AppendFilter ¶
func (c *CommandFilters) AppendFilter( filter kvserverbase.ReplicaCommandFilter, idempotent bool, ) func()
AppendFilter registers a filter function to run after all the previously registered filters. idempotent specifies if this filter can be safely run multiple times on the same command. If this property doesn't hold, CommandFilters will start tracking commands for replay protection, which might be expensive. Returns a closure that the client must run for doing cleanup when the filter should be deregistered.
func (*CommandFilters) RunFilters ¶
func (c *CommandFilters) RunFilters(args kvserverbase.FilterArgs) *roachpb.Error
RunFilters executes the registered filters, stopping at the first one that returns an error.