Function tikv::storage::txn::actions::cleanup::cleanup[][src]

pub fn cleanup<S: Snapshot>(
    txn: &mut MvccTxn,
    reader: &mut SnapshotReader<S>,
    key: Key,
    current_ts: TimeStamp,
    protect_rollback: bool
) -> MvccResult<Option<ReleasedLock>>

Cleanup the lock if it’s TTL has expired, comparing with current_ts. If current_ts is 0, cleanup the lock without checking TTL. If the lock is the primary lock of a pessimistic transaction, the rollback record is protected from being collapsed.

Returns the released lock. Returns error if the key is locked or has already been committed.