From 9b43e3f0075451ab41ae7c679aea251f082d4e21 Mon Sep 17 00:00:00 2001 From: mbutrovich Date: Tue, 26 Jun 2018 10:32:57 -0400 Subject: [PATCH 1/2] Set LastReaderCommitId on insert, update, and delete versions. Addresses parts 5 and 6 of #1420. --- src/concurrency/timestamp_ordering_transaction_manager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/concurrency/timestamp_ordering_transaction_manager.cpp b/src/concurrency/timestamp_ordering_transaction_manager.cpp index 3a39ccc8877..b76e407801f 100644 --- a/src/concurrency/timestamp_ordering_transaction_manager.cpp +++ b/src/concurrency/timestamp_ordering_transaction_manager.cpp @@ -358,6 +358,7 @@ 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. @@ -412,6 +413,7 @@ 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. @@ -515,6 +517,7 @@ 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); From e7a3447f44cd752d530751584695293d9400d071 Mon Sep 17 00:00:00 2001 From: mbutrovich Date: Tue, 26 Jun 2018 10:33:54 -0400 Subject: [PATCH 2/2] clang-format. --- .../timestamp_ordering_transaction_manager.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/concurrency/timestamp_ordering_transaction_manager.cpp b/src/concurrency/timestamp_ordering_transaction_manager.cpp index b76e407801f..1deeccd0609 100644 --- a/src/concurrency/timestamp_ordering_transaction_manager.cpp +++ b/src/concurrency/timestamp_ordering_transaction_manager.cpp @@ -358,7 +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()); + tile_group_header->SetLastReaderCommitId(tuple_id, + current_txn->GetCommitId()); // no need to set next item pointer. @@ -413,7 +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()); + 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. @@ -517,7 +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->SetLastReaderCommitId(new_location.offset, + current_txn->GetCommitId()); new_tile_group_header->SetEndCommitId(new_location.offset, INVALID_CID);