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

Set LastReaderCommitId on new versions #1429

Merged
merged 3 commits into from
Jun 26, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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