@@ -66,6 +66,9 @@ bool TimestampOrderingTransactionManager::SetLastReaderCommitId(
66
66
// then set last_reader_cid to current_cid.
67
67
if (*ts_ptr < current_cid) {
68
68
*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;
69
72
}
70
73
71
74
GetSpinLatchField (tile_group_header, tuple_id)->Unlock ();
@@ -779,7 +782,7 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
779
782
if (static_cast <StatsType>(settings::SettingsManager::GetInt (settings::SettingId::stats_mode)) !=
780
783
StatsType::INVALID) {
781
784
if (!rw_set.IsEmpty ()) {
782
- // Call the GetIterator () function to explicitly lock the cuckoohash
785
+ // Call the GetConstIterator () function to explicitly lock the cuckoohash
783
786
// and initilaize the iterator
784
787
auto rw_set_lt = rw_set.GetConstIterator ();
785
788
const auto tile_group_id = rw_set_lt.begin ()->first .block ;
@@ -793,7 +796,7 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
793
796
// 3. install a new tuple for insert operations.
794
797
// Iterate through each item pointer in the read write set
795
798
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
797
800
// tile_group_header for each entry. Check if this needs to be consolidated
798
801
for (const auto &tuple_entry : rw_set.GetConstIterator ()) {
799
802
ItemPointer item_ptr = tuple_entry.first ;
@@ -955,7 +958,7 @@ ResultType TimestampOrderingTransactionManager::AbortTransaction(
955
958
if (static_cast <StatsType>(settings::SettingsManager::GetInt (settings::SettingId::stats_mode)) !=
956
959
StatsType::INVALID) {
957
960
if (!rw_set.IsEmpty ()) {
958
- // Call the GetIterator () function to explicitly lock the cuckoohash
961
+ // Call the GetConstIterator () function to explicitly lock the cuckoohash
959
962
// and initilaize the iterator
960
963
auto rw_set_lt = rw_set.GetConstIterator ();
961
964
const auto tile_group_id = rw_set_lt.begin ()->first .block ;
@@ -964,7 +967,7 @@ ResultType TimestampOrderingTransactionManager::AbortTransaction(
964
967
}
965
968
966
969
// 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
968
971
// tile_group_header for each entry. Check if this needs to be consolidated
969
972
for (const auto &tuple_entry : rw_set.GetConstIterator ()) {
970
973
ItemPointer item_ptr = tuple_entry.first ;
0 commit comments