src/backend/concurrency/optimistic_txn_manager.cpp
// this function is invoked when it is NOT the first time to update the tuple.
// the tuple passed into this function is the local version created by this txn.
this function is invoked when it is NOT the first time to update the tuple.
the tuple passed into this function is the local version created by this txn.
this function is invoked when it is NOT the first time to update the tuple . the tuple passed into this function is the local version created by this txn .
void OptimisticTxnManager::PerformUpdate(const ItemPointer &location) {
  oid_t tile_group_id = location.block;
  oid_t tuple_id = location.offset;
  auto &manager = catalog::Manager::GetInstance();
  auto tile_group_header = manager.GetTileGroup(tile_group_id)->GetHeader();
  assert(tile_group_header->GetTransactionId(tuple_id) ==
         current_txn->GetTransactionId());
  assert(tile_group_header->GetBeginCommitId(tuple_id) == MAX_CID);
  assert(tile_group_header->GetEndCommitId(tuple_id) == MAX_CID);
  auto old_location = tile_group_header->GetPrevItemPointer(tuple_id);
  if (old_location.IsNull() == false) {
    current_txn->RecordUpdate(old_location);
  }
}
void OptimisticTxnManager :: PerformUpdate ( const ItemPointer & location ) { oid_t tile_group_id = location . block ; oid_t tuple_id = location . offset ; auto & manager = catalog :: Manager :: GetInstance ( ) ; auto tile_group_header = manager . GetTileGroup ( tile_group_id ) -> GetHeader ( ) ; assert ( tile_group_header -> GetTransactionId ( tuple_id ) == current_txn -> GetTransactionId ( ) ) ; assert ( tile_group_header -> GetBeginCommitId ( tuple_id ) == MAX_CID ) ; assert ( tile_group_header -> GetEndCommitId ( tuple_id ) == MAX_CID ) ; auto old_location = tile_group_header -> GetPrevItemPointer ( tuple_id ) ; if ( old_location . IsNull ( ) == false ) { current_txn -> RecordUpdate ( old_location ) ; } }
this function is invoked when it is NOT the first time to update the tuple.
this function is invoked when it is NOT the first time to update the tuple .
// Add the old tuple into the update set // if this version is not newly inserted.