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

Commit 91b8c11

Browse files
Address review comments and try to fix Jenkins failure
1 parent c863aa0 commit 91b8c11

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/concurrency/timestamp_ordering_transaction_manager.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ bool TimestampOrderingTransactionManager::SetLastReaderCommitId(
6666
// then set last_reader_cid to current_cid.
6767
if (*ts_ptr < current_cid) {
6868
*ts_ptr = current_cid;
69+
// Since we need this memory address to be updated before other
70+
// transactions attempt to modify/read the tuple.
71+
COMPILER_MEMORY_FENCE;
6972
}
7073

7174
GetSpinLatchField(tile_group_header, tuple_id)->Unlock();
@@ -779,7 +782,7 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
779782
if (static_cast<StatsType>(settings::SettingsManager::GetInt(settings::SettingId::stats_mode)) !=
780783
StatsType::INVALID) {
781784
if (!rw_set.IsEmpty()) {
782-
// Call the GetIterator() function to explicitly lock the cuckoohash
785+
// Call the GetConstIterator() function to explicitly lock the cuckoohash
783786
// and initilaize the iterator
784787
auto rw_set_lt = rw_set.GetConstIterator();
785788
const auto tile_group_id = rw_set_lt.begin()->first.block;
@@ -793,7 +796,7 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
793796
// 3. install a new tuple for insert operations.
794797
// Iterate through each item pointer in the read write set
795798

796-
// TODO: This might be inefficient since we will have to get the
799+
// TODO (Pooja): This might be inefficient since we will have to get the
797800
// tile_group_header for each entry. Check if this needs to be consolidated
798801
for (const auto &tuple_entry : rw_set.GetConstIterator()) {
799802
ItemPointer item_ptr = tuple_entry.first;
@@ -955,7 +958,7 @@ ResultType TimestampOrderingTransactionManager::AbortTransaction(
955958
if (static_cast<StatsType>(settings::SettingsManager::GetInt(settings::SettingId::stats_mode)) !=
956959
StatsType::INVALID) {
957960
if (!rw_set.IsEmpty()) {
958-
// Call the GetIterator() function to explicitly lock the cuckoohash
961+
// Call the GetConstIterator() function to explicitly lock the cuckoohash
959962
// and initilaize the iterator
960963
auto rw_set_lt = rw_set.GetConstIterator();
961964
const auto tile_group_id = rw_set_lt.begin()->first.block;
@@ -964,7 +967,7 @@ ResultType TimestampOrderingTransactionManager::AbortTransaction(
964967
}
965968

966969
// Iterate through each item pointer in the read write set
967-
// TODO: This might be inefficient since we will have to get the
970+
// TODO (Pooja): This might be inefficient since we will have to get the
968971
// tile_group_header for each entry. Check if this needs to be consolidated
969972
for (const auto &tuple_entry : rw_set.GetConstIterator()) {
970973
ItemPointer item_ptr = tuple_entry.first;

0 commit comments

Comments
 (0)