package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Functions
Barrier evaluation is a no-op, but it still goes through Raft because of BatchRequest.RequiresConsensus().
BumpToMinTxnCommitTS increases the provided transaction's write timestamp to the minimum timestamp at which it is allowed to commit.
CanCreateTxnRecord determines whether a transaction record can be created for the provided transaction.
ClearRange wipes all MVCC versions of keys covered by the specified span, adjusting the MVCC stats accordingly.
CollectIntentRows collects the provisional key-value pairs for each intent provided.
ComputeChecksum starts the process of computing a checksum on the replica at a particular snapshot.
ConditionalPut sets the value for a specified key only if the expected value matches.
DeclareKeysForBatch adds all keys that the batch with the provided header touches to the given SpanSet.
DeclareKeysForRefresh determines whether a Refresh request should declare locks and go through the lock table or not.
DefaultDeclareIsolatedKeys is similar to DefaultDeclareKeys, but it declares both lock spans in addition to latch spans.
DefaultDeclareKeys is the default implementation of Command.DeclareKeys.
Delete deletes the key and value specified by key.
DeleteRange deletes the range of key/value pairs specified by start and end keys.
EndTxn either commits or aborts (rolls back) an extant transaction according to the args.Commit parameter.
EvalAddSSTable evaluates an AddSSTable command.
EvalLinkExternalSSTable evaluates a LinkExternalSSTable command.
GC iterates through the list of keys to garbage collect specified in the arguments.
Get returns the value for a specified key.
HeartbeatTxn updates the transaction status and heartbeat timestamp after receiving transaction heartbeat messages from coordinator.
Increment increments the value (interpreted as varint64 encoded) and returns the newly incremented value (encoded as varint64).
InitPut sets the value for a specified key only if it doesn't exist.
IsEndTxnExceedingDeadline returns true if the transaction's provisional commit timestamp exceeded its deadline.
IsEndTxnTriggeringRetryError returns true if the Transaction cannot be committed and needs to return a TransactionRetryError.
IsSpanEmpty determines whether there are any keys in the key span requested at any time.
LeaseInfo returns information about the lease holder for the range.
LookupCommand returns the command for the given method, with the boolean indicating success or failure.
MakeStateLoader creates a StateLoader for the EvalContext.
Merge is used to merge a value into an existing key.
Migrate executes the below-raft migration corresponding to the given version.
Probe causes an effectless round-trip through the replication layer, i.e.
PushTxn resolves conflicts between concurrent txns (or between a non-transactional reader or writer and a txn) in several ways, depending on the statuses and priorities of the conflicting transactions.
Put sets the value for a specified key.
QueryIntent checks if an intent exists for the specified transaction at the given key.
QueryLocks uses the concurrency manager to query the state of locks currently tracked by the in-memory lock table across a specified range of keys.
QueryResolvedTimestamp requests a resolved timestamp for the key span it is issued over.
QueryTxn fetches the current state of a transaction.
RangeStats returns the MVCC statistics for a range.
RecomputeStats recomputes the MVCCStats stored for this range and adjust them accordingly, returning the MVCCStats delta obtained in the process.
RecoverTxn attempts to recover the specified transaction from an indeterminate commit state.
Refresh checks whether the key has any values written in the interval (args.RefreshFrom, header.Timestamp].
RefreshRange checks whether the key range specified has any values written in the interval (args.RefreshFrom, header.Timestamp].
RegisterReadOnlyCommand makes a read-only command available for execution.
RegisterReadWriteCommand makes a read-write command available for execution.
RequestLease sets the range lease for this range.
ResolveIntent resolves a write intent from the specified key according to the status of the transaction which created it.
ResolveIntentRange resolves write intents in the specified key range according to the status of the transaction which created it.
ReverseScan scans the key range specified by start key through end key in descending order up to some maximum number of results.
RevertRange wipes all MVCC versions more recent than TargetTime (up to the command timestamp) of the keys covered by the specified span, adjusting the MVCC stats accordingly.
RunCommitTrigger runs the commit trigger from an end transaction request.
Scan scans the key range specified by start key through end key in ascending order up to some maximum number of results.
Subsume freezes a range for merging with its left-hand neighbor.
SynthesizeTxnFromMeta creates a synthetic transaction object from the provided transaction metadata.
TestingRegisterMigrationInterceptor is used in tests to register an interceptor for a below-raft migration.
TransferLease sets the lease holder for the range.
TruncateLog discards a prefix of the raft log.
UnregisterCommand is provided for testing and allows removing a command.
UpdateAbortSpan clears any AbortSpan entry if poison is false.
VerifyTransaction runs sanity checks verifying that the transaction in the header and the request are compatible.
WriteAbortSpanOnResolve returns true if the abort span must be written when the transaction with the given status is resolved.
# Constants
512KiB.
MaxExportOverageSetting is the cluster setting name for the ExportRequestMaxAllowedFileSizeOverage setting.
ReplicaChecksumVersion versions the checksum computation.
SSTTargetSizeSetting is the cluster setting name for the ExportRequestTargetFileSize setting.
# Variables
AddSSTableRequireAtRequestTimestamp will reject any AddSSTable requests that aren't sent with SSTTimestampToRequestTimestamp.
AddSSTableRewriteConcurrency sets the concurrency of a single SST rewrite.
ErrTransactionUnsupported is returned when a non-transactional command is evaluated in the context of a transaction.
ExportRequestMaxAllowedFileSizeOverage controls the maximum size in excess of the target file size which an exported SST may be.
ExportRequestTargetFileSize controls the target file size for SSTs created during backups.
5.12 MB = 1% of the max range size.
MaxMVCCStatCountDiff defines the maximum number of units (e.g.
QueryResolvedTimestampIntentCleanupAge configures the minimum intent age that QueryResolvedTimestamp requests will consider for async intent cleanup.
RecomputeStatsMismatchError indicates that the start key provided in the request arguments doesn't match the start key of the range descriptor.
# Structs
A Command is the implementation of a single request within a BatchRequest.
CommandArgs contains all the arguments to a command.
Limiters is the collection of per-store limits used during cmd evaluation.
MockEvalCtx is a dummy implementation of EvalContext for testing purposes.
# Interfaces
EvalContext is the interface through which command evaluation accesses the underlying state.
ImmutableEvalContext is like EvalContext, but it encapsulates state that needs to be immutable during the course of command evaluation.
ImmutableRangeState exposes the properties of a Range that cannot change across a Range's lifetime.
# Type aliases
DeclareKeysFunc adds all key spans that a command touches to the latchSpans set.