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

Commit d3e3289

Browse files
mbutrovichtli2
authored andcommitted
Set LastReaderCommitId on new versions (#1429)
* Set LastReaderCommitId on insert, update, and delete versions. Addresses parts 5 and 6 of #1420.
1 parent f83d538 commit d3e3289

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/concurrency/timestamp_ordering_transaction_manager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,8 @@ void TimestampOrderingTransactionManager::PerformInsert(
358358
PELOTON_ASSERT(tile_group_header->GetEndCommitId(tuple_id) == MAX_CID);
359359

360360
tile_group_header->SetTransactionId(tuple_id, transaction_id);
361+
tile_group_header->SetLastReaderCommitId(tuple_id,
362+
current_txn->GetCommitId());
361363

362364
// no need to set next item pointer.
363365

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

414416
new_tile_group_header->SetTransactionId(new_location.offset, transaction_id);
417+
new_tile_group_header->SetLastReaderCommitId(new_location.offset,
418+
current_txn->GetCommitId());
415419

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

517521
new_tile_group_header->SetTransactionId(new_location.offset, transaction_id);
522+
new_tile_group_header->SetLastReaderCommitId(new_location.offset,
523+
current_txn->GetCommitId());
518524

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

0 commit comments

Comments
 (0)