Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
Set LastReaderCommitId on new versions (#1429)
Browse files Browse the repository at this point in the history
* Set LastReaderCommitId on insert, update, and delete versions. Addresses parts 5 and 6 of #1420.
  • Loading branch information
mbutrovich authored and tli2 committed Jun 26, 2018
1 parent f83d538 commit d3e3289
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/concurrency/timestamp_ordering_transaction_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ void TimestampOrderingTransactionManager::PerformInsert(
PELOTON_ASSERT(tile_group_header->GetEndCommitId(tuple_id) == MAX_CID);

tile_group_header->SetTransactionId(tuple_id, transaction_id);
tile_group_header->SetLastReaderCommitId(tuple_id,
current_txn->GetCommitId());

// no need to set next item pointer.

Expand Down Expand Up @@ -412,6 +414,8 @@ void TimestampOrderingTransactionManager::PerformUpdate(
new_tile_group_header->SetNextItemPointer(new_location.offset, old_location);

new_tile_group_header->SetTransactionId(new_location.offset, transaction_id);
new_tile_group_header->SetLastReaderCommitId(new_location.offset,
current_txn->GetCommitId());

// we should guarantee that the newer version is all set before linking the
// newer version to older version.
Expand Down Expand Up @@ -515,6 +519,8 @@ void TimestampOrderingTransactionManager::PerformDelete(
new_tile_group_header->SetNextItemPointer(new_location.offset, old_location);

new_tile_group_header->SetTransactionId(new_location.offset, transaction_id);
new_tile_group_header->SetLastReaderCommitId(new_location.offset,
current_txn->GetCommitId());

new_tile_group_header->SetEndCommitId(new_location.offset, INVALID_CID);

Expand Down

0 comments on commit d3e3289

Please sign in to comment.