package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev

# Packages

Package kvclient houses the implementation of the KV client.
Package kvnemesis exercises the KV API with random concurrent traffic (as well as splits, merges, etc) and then validates that the observed behaviors are serializable.
Package kvpb contains basic utilities for the kv layer.
Package kvprober sends queries to KV in a loop, with configurable sleep times, in order to generate data about the healthiness or unhealthiness of kvclient & below.
Package kvserver provides access to the Store and Range abstractions.

# Functions

AdmissionHeaderForBypass alters the admission header so that admission control can be bypassed.
AdmissionHeaderForLockUpdateForTxn constructs the admission header for the given LockUpdate being done by txn.
DefaultDBContext returns (a copy of) the default options for NewDBWithContext.
IncrementValRetryable increments a key's value by a specified amount and returns the new value.
IsAutoRetryLimitExhaustedError checks if the given error indicates that the maximum number of transaction auto-retries has been reached.
IsExpectedRelocateError maintains an allowlist of errors related to atomic-replication-changes we want to ignore / retry on for tests.
MakeMockTxnSenderFactory creates a MockTxnSenderFactory from a sender function that receives the transaction in addition to the request.
MakeMockTxnSenderFactoryWithNonTxnSender creates a MockTxnSenderFactory from two sender functions: one for transactional and one for non-transactional requests.
MergeAdmissionHeaderForBatch merges admission headers to pick the highest priority and oldest CreateTime.
NewDB returns a new DB.
NewDBWithContext returns a new DB with the given parameters.
NewLeafTxn instantiates a new leaf transaction.
NewMockTransactionalSender creates a MockTransactionalSender.
NewTxn returns a new RootTxn.
NewTxnFromProto is like NewTxn but assumes the Transaction object is already initialized.
NewTxnRootKV is like NewTxn but specifically represents a transaction originating within KV and that is at the root of the tree of requests.
NewTxnWithAdmissionControl creates a new transaction with the specified admission control source and priority.
NewTxnWithSteppingEnabled is like NewTxn but suitable for use by SQL.
OnlyFollowerReads looks through all the RPCs and asserts that every single one resulted in a follower read.
RangeLookup is used to look up RangeDescriptors - a RangeDescriptor is a metadata structure which describes the key range and replica locations of a distinct range in the cluster.
SendWrapped is identical to SendWrappedWith with a zero header.
SendWrappedWith is a convenience function which wraps the request in a batch and sends it via the provided Sender and headers.
SendWrappedWithAdmission is a convenience function which wraps the request in a batch and sends it via the provided Sender and headers.
TestingIsRangeLookup returns if the provided BatchRequest looks like a single RangeLookup scan.
TestingIsRangeLookupRequest returns if the provided Request looks like a single RangeLookup scan.
Wrap returns a Sender which applies the given function before delegating to the supplied Sender.

# Constants

LeafTxn specifies this sender is for one of potentially many distributed client transactions.
RandomTxnRetryProbability is the probability that a transaction will inject a retryable error when either the RandomTransactionRetryFilter testing filter is installed or the COCKROACH_FORCE_RANDOM_TXN_RETRIES environment variable is set.
RootTxn specifies this sender is the root transaction, and is responsible for aggregating all transactional state and finalizing the transaction.
SteppingDisabled is the default mode, where each read can observe the latest write.
SteppingEnabled can be set to indicate that read operations operate on a snapshot taken at the latest Step() invocation.

# Variables

MaxInternalTxnAutoRetries controls the maximum number of auto-retries a call to kv.DB.Txn will perform before aborting the transaction and returning an error.

# Structs

AutoCommitError wraps a non-retryable error coming from auto-commit.
Batch provides for the parallel execution of a number of database operations.
CrossRangeTxnWrapperSender is a Sender whose purpose is to wrap non-transactional requests that span ranges into a transaction so they can execute atomically.
DB is a database handle to a single cockroach cluster.
DBContext contains configuration parameters for DB.
KeyValue represents a single key/value pair.
MockTransactionalSender allows a function to be used as a TxnSender.
MockTxnSenderFactory is a TxnSenderFactory producing MockTxnSenders.
OnePCNotAllowedError signifies that a request had the Require1PC flag set, but 1PC evaluation was not possible for one reason or another.
Result holds the result for a single DB or Txn operation (e.g.
Txn is an in-progress distributed database transaction.

# Interfaces

BulkSource is a generator interface for efficiently adding lots of requests.
BulkSourceIterator is the iterator interface for bulk put operations.
GValue is a generic value for use in generic code.
SavepointToken represents a savepoint.
Sender is implemented by modules throughout the crdb stack, on both the "client" and the "server", involved in passing along and ultimately evaluating requests (batches).
TxnSender is the interface used to call into a CockroachDB instance when sending transactional requests.
TxnSenderFactory is the interface used to create new instances of TxnSender.

# Type aliases

NonTransactionalFactoryFunc is a TxnSenderFactory that cannot, in fact, create any transactional senders, only non-transactional ones.
SenderFunc is an adapter to allow the use of ordinary functions as Senders.
SteppingMode is the argument type to ConfigureStepping.
TxnType specifies whether a transaction is the root (parent) transaction, or a leaf (child) in a tree of kv.Txns, as is used in a DistSQL flow.