Module tikv::storage::txn::commands::prewrite [−][src]
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.
Structs
Optimistic | Optimistic |
Pessimistic | Pessimistic |
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. |
Prewriter | Handles both kinds of prewrite (K statically indicates either optimistic or pessimistic). |
Constants
FORWARD_MIN_MUTATIONS_NUM |
Traits
MutationLock | The type of mutation and, optionally, its extra information, differing for the
optimistic and pessimistic transaction.
For optimistic txns, this is |
PrewriteKind | Encapsulates things which must be done differently for optimistic or pessimistic transactions. |
Functions
fallback_1pc_locks | Change all 1pc locks in txn to 2pc locks. |
handle_1pc_locks | Commit and delete all 1pc locks in txn. |
one_pc_commit_ts | Compute the commit ts of a 1pc transaction. |