Module tikv::storage::txn::commands[][src]

Commands used in the transaction system

Modules

acquire_pessimistic_lock
atomic_store
check_secondary_locks
check_txn_status
cleanup
commit
compare_and_swap
macros
mvcc_by_key
mvcc_by_start_ts
pause
pessimistic_rollback
prewrite

Functionality for handling optimistic and pessimistic prewrites. These are separate commands (although maybe they shouldn’t be since there is only one protobuf), but handling of the commands is similar. We therefore have a single type (Prewriter) to handle both kinds of prewrite.

resolve_lock
resolve_lock_lite
resolve_lock_readphase
rollback
txn_heart_beat

Structs

AcquirePessimisticLock

Acquire a Pessimistic lock on the keys.

CheckSecondaryLocks

Check secondary locks of an async commit transaction.

CheckTxnStatus

Check the status of a transaction. This is usually invoked by a transaction that meets another transaction’s lock. If the primary lock is expired, it will rollback the primary lock. If the primary lock exists but is not expired, it may update the transaction’s min_commit_ts. Returns a TxnStatus to represent the status.

Cleanup

Rollback mutations on a single key.

Commit

Commit the transaction that started at lock_ts.

MvccByKey

Retrieve MVCC information for the given key.

MvccByStartTs

Retrieve MVCC info for the first committed key which start_ts == ts.

Pause

Testing functionality: Latch the given keys for given duration.

PessimisticRollback

Rollback pessimistic locks identified by start_ts and for_update_ts.

Prewrite

The prewrite phase of a transaction. The first phase of 2PC.

PrewritePessimistic

The prewrite phase of a transaction using pessimistic locking. The first phase of 2PC.

RawAtomicStore

Run Put or Delete for keys which may be changed by RawCompareAndSwap.

RawCompareAndSwap

RawCompareAndSwap checks whether the previous value of the key equals to the given value. If they are equal, write the new value. The bool indicates whether they are equal. The previous value is always returned regardless of whether the new value is set.

ReleasedLocks
ResolveLock

Resolve locks according to txn_status.

ResolveLockLite

Resolve locks on resolve_keys according to start_ts and commit_ts.

ResolveLockReadPhase

Scan locks for resolving according to txn_status.

Rollback

Rollback from the transaction that was started at start_ts.

TxnHeartBeat

Heart beat of a transaction. It enlarges the primary lock’s TTL.

TypedCommand

A Command with its return type, reified as the generic parameter T.

WriteContext
WriteResult
WriteResultLockInfo

Enums

Command

Store Transaction scheduler commands.

ResponsePolicy

Represents for a scheduler command, when should the response sent to the client. For most cases, the response should be sent after the result being successfully applied to the storage (if needed). But in some special cases, some optimizations allows the response to be returned at an earlier phase.

Constants

RESOLVE_LOCK_BATCH_SIZE

Traits

CommandExt
ReadCommand

Commands that do not need to modify the database during execution will implement this trait.

WriteCommand

Commands that need to modify the database during execution will implement this trait.

Functions

find_mvcc_infos_by_key
one_pc_commit_ts

Compute the commit ts of a 1pc transaction.

Type Definitions

LockWritesVals