src/backend/concurrency/optimistic_txn_manager.cpp
// get write lock on a tuple.
// this is invoked by update/delete executors.
get write lock on a tuple.
this is invoked by update/delete executors.
get write lock on a tuple . this is invoked by update / delete executors .
bool OptimisticTxnManager::AcquireOwnership(
    const storage::TileGroupHeader *const tile_group_header,
    const oid_t &tile_group_id __attribute__((unused)), const oid_t &tuple_id) {
  auto txn_id = current_txn->GetTransactionId();
  if (tile_group_header->SetAtomicTransactionId(tuple_id, txn_id) == false) {
    LOG_ERROR("Fail to acquire tuple. Set txn failure.");
    SetTransactionResult(Result::RESULT_FAILURE);
    return false;
  }
  return true;
}
bool OptimisticTxnManager :: AcquireOwnership ( const storage :: TileGroupHeader * const tile_group_header , const oid_t & tile_group_id __attribute__ ( ( unused ) ) , const oid_t & tuple_id ) { auto txn_id = current_txn -> GetTransactionId ( ) ; if ( tile_group_header -> SetAtomicTransactionId ( tuple_id , txn_id ) == false ) { LOG_ERROR ( " " ) ; SetTransactionResult ( Result :: RESULT_FAILURE ) ; return false ; } return true ; }
get write lock on a tuple.
get write lock on a tuple .