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

Commit c37e6ef

Browse files
committed
PR feedback changes.
1 parent 07d75b3 commit c37e6ef

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

src/concurrency/timestamp_ordering_transaction_manager.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -653,9 +653,6 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
653653
// 3. install a new tuple for insert operations.
654654
// Iterate through each item pointer in the read write set
655655

656-
// TODO (Pooja): This might be inefficient since we will have to get the
657-
// tile_group_header for each entry. Check if this needs to be consolidated
658-
659656
oid_t last_tile_group_id = INVALID_OID;
660657
storage::TileGroupHeader *tile_group_header = nullptr;
661658

@@ -813,8 +810,6 @@ ResultType TimestampOrderingTransactionManager::AbortTransaction(
813810
}
814811

815812
// Iterate through each item pointer in the read write set
816-
// TODO (Pooja): This might be inefficient since we will have to get the
817-
// tile_group_header for each entry. Check if this needs to be consolidated
818813

819814
oid_t last_tile_group_id = INVALID_OID;
820815
storage::TileGroupHeader *tile_group_header = nullptr;

src/concurrency/transaction_context.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,17 @@ void TransactionContext::RecordInsert(const ItemPointer &location) {
126126
rw_set_[location] = RWType::INSERT;
127127
}
128128

129-
void TransactionContext::RecordDelete(const ItemPointer &location) {
129+
bool TransactionContext::RecordDelete(const ItemPointer &location) {
130130
PELOTON_ASSERT(rw_set_.count(location) == 0 ||
131131
(rw_set_[location] != RWType::DELETE &&
132132
rw_set_[location] != RWType::INS_DEL));
133133
auto rw_set_it = rw_set_.find(location);
134134
if (rw_set_it != rw_set_.end() && rw_set_it->second == RWType::INSERT) {
135135
rw_set_it->second = RWType::INS_DEL;
136+
return true;
136137
} else {
137138
rw_set_[location] = RWType::DELETE;
139+
return false;
138140
}
139141
}
140142

src/include/concurrency/transaction_context.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,9 @@ class TransactionContext : public Printable {
171171
* @brief Delete the record.
172172
*
173173
* @param[in] <unnamed> The logical physical location of the record
174+
* @return true if INS_DEL, false if DELETE
174175
*/
175-
void RecordDelete(const ItemPointer &);
176+
bool RecordDelete(const ItemPointer &);
176177

177178
RWType GetRWType(const ItemPointer &);
178179

test/common/lock_free_array_test.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,23 +101,21 @@ TEST_F(LockFreeArrayTests, FindValidAndEraseTest) {
101101
{
102102
LockFreeArray<value_type> array;
103103

104-
value_type invalid_value = 6288;
105-
106104
size_t const element_count = 3;
107105
for (size_t element = 0; element < element_count; ++element) {
108106
array.Append(element);
109107
}
110108

111109
// in range, valid
112-
EXPECT_EQ(2, array.FindValid(2, invalid_value));
110+
EXPECT_EQ(2, array.FindValid(2, INVALID_OID));
113111

114112
// out of range
115-
EXPECT_EQ(invalid_value, array.FindValid(6, invalid_value));
113+
EXPECT_EQ(INVALID_OID, array.FindValid(6, INVALID_OID));
116114

117-
array.Erase(2, invalid_value);
115+
array.Erase(2, INVALID_OID);
118116

119117
// in range, erased
120-
EXPECT_EQ(invalid_value, array.FindValid(2, invalid_value));
118+
EXPECT_EQ(INVALID_OID, array.FindValid(2, INVALID_OID));
121119
}
122120
}
123121

0 commit comments

Comments
 (0)