@@ -775,20 +775,19 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
775
775
gc_object_set->emplace_back (database_oid, table_oid, index_oid);
776
776
}
777
777
778
+ // Call the GetIterator() function to explicitly lock the cuckoohash
779
+ // and initilaize the iterator
780
+ auto rw_set_lt = rw_set.GetConstIterator ();
781
+
778
782
oid_t database_id = 0 ;
779
783
if (static_cast <StatsType>(settings::SettingsManager::GetInt (settings::SettingId::stats_mode)) !=
780
784
StatsType::INVALID) {
781
785
if (!rw_set.IsEmpty ()) {
782
- auto rw_set_iterator = rw_set.GetConstIterator ();
783
- const auto tile_group_id = rw_set_iterator.begin ()->first .block ;
786
+ const auto tile_group_id = rw_set_lt.begin ()->first .block ;
784
787
database_id = manager.GetTileGroup (tile_group_id)->GetDatabaseId ();
785
788
}
786
789
}
787
790
788
- // Call the GetIterator() function to explicitly lock the cuckoohash
789
- // and initilaize the iterator
790
- auto rw_set_lt = rw_set.GetConstIterator ();
791
-
792
791
// install everything.
793
792
// 1. install a new version for update operations;
794
793
// 2. install an empty version for delete operations;
@@ -952,20 +951,20 @@ ResultType TimestampOrderingTransactionManager::AbortTransaction(
952
951
gc_object_set->emplace_back (database_oid, table_oid, index_oid);
953
952
}
954
953
954
+
955
+ // Call the GetIterator() function to explicitly lock the cuckoohash
956
+ // and initilaize the iterator
957
+ auto rw_set_lt = rw_set.GetConstIterator ();
958
+
955
959
oid_t database_id = 0 ;
956
960
if (static_cast <StatsType>(settings::SettingsManager::GetInt (settings::SettingId::stats_mode)) !=
957
961
StatsType::INVALID) {
958
962
if (!rw_set.IsEmpty ()) {
959
- auto rw_set_iterator = rw_set.GetConstIterator ();
960
- const auto tile_group_id = rw_set_iterator.begin ()->first .block ;
963
+ const auto tile_group_id = rw_set_lt.begin ()->first .block ;
961
964
database_id = manager.GetTileGroup (tile_group_id)->GetDatabaseId ();
962
965
}
963
966
}
964
967
965
- // Call the GetIterator() function to explicitly lock the cuckoohash
966
- // and initilaize the iterator
967
- auto rw_set_lt = rw_set.GetConstIterator ();
968
-
969
968
// Iterate through each item pointer in the read write set
970
969
// TODO: This might be inefficient since we will have to get the
971
970
// tile_group_header for each entry. Check if this needs to be consolidated
0 commit comments