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

Commit 29f92eb

Browse files
mbutrovichtli2
authored andcommitted
Skip recording READs in the RWSet. (#1425)
1 parent 55abc0c commit 29f92eb

File tree

3 files changed

+4
-25
lines changed

3 files changed

+4
-25
lines changed

src/concurrency/timestamp_ordering_transaction_manager.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ bool TimestampOrderingTransactionManager::PerformRead(TransactionContext *const
201201
return true;
202202

203203
} else {
204-
// if it's not select for update, then update read set and return true.
205-
current_txn->RecordRead(location);
204+
// if it's not select for update, then return true.
206205
return true;
207206
}
208207

@@ -243,7 +242,6 @@ bool TimestampOrderingTransactionManager::PerformRead(TransactionContext *const
243242
// a transaction can never read an uncommitted version.
244243
if (IsOwner(current_txn, tile_group_header, tuple_id) == false) {
245244
if (IsOwned(current_txn, tile_group_header, tuple_id) == false) {
246-
current_txn->RecordRead(location);
247245
return true;
248246

249247
} else {
@@ -316,8 +314,6 @@ bool TimestampOrderingTransactionManager::PerformRead(TransactionContext *const
316314
// then attempt to set last reader cid.
317315
if (SetLastReaderCommitId(tile_group_header, tuple_id,
318316
current_txn->GetCommitId(), false) == true) {
319-
// update read set.
320-
current_txn->RecordRead(location);
321317
return true;
322318
} else {
323319
// if the tuple has been owned by some concurrent transactions,

src/concurrency/transaction_context.cpp

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,35 +94,20 @@ RWType TransactionContext::GetRWType(const ItemPointer &location) {
9494
return RWType::INVALID;
9595
}
9696

97-
void TransactionContext::RecordRead(const ItemPointer &location) {
98-
PELOTON_ASSERT(rw_set_.find(location) == rw_set_.end() ||
99-
(rw_set_[location] != RWType::DELETE &&
100-
rw_set_[location] != RWType::INS_DEL));
101-
auto rw_set_it = rw_set_.find(location);
102-
if (rw_set_it != rw_set_.end()) {
103-
return;
104-
}
105-
rw_set_[location] = RWType::READ;
106-
}
107-
10897
void TransactionContext::RecordReadOwn(const ItemPointer &location) {
10998
PELOTON_ASSERT(rw_set_.find(location) == rw_set_.end() ||
11099
(rw_set_[location] != RWType::DELETE &&
111100
rw_set_[location] != RWType::INS_DEL));
112101
rw_set_[location] = RWType::READ_OWN;
102+
is_written_ = true;
113103
}
114104

115105
void TransactionContext::RecordUpdate(const ItemPointer &location) {
116106
PELOTON_ASSERT(rw_set_.find(location) == rw_set_.end() ||
117107
(rw_set_[location] != RWType::DELETE &&
118108
rw_set_[location] != RWType::INS_DEL));
119-
auto rw_set_it = rw_set_.find(location);
120-
if (rw_set_it != rw_set_.end() && (rw_set_it->second == RWType::READ ||
121-
rw_set_it->second == RWType::READ_OWN)) {
122-
rw_set_it->second = RWType::UPDATE;
123-
is_written_ = true;
124-
}
125-
PELOTON_ASSERT(is_written_);
109+
rw_set_[location] = RWType::UPDATE;
110+
is_written_ = true;
126111
}
127112

128113
void TransactionContext::RecordInsert(const ItemPointer &location) {

src/include/concurrency/transaction_context.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ class TransactionContext : public Printable {
159159
index_oid, DDLType::DROP));
160160
}
161161

162-
void RecordRead(const ItemPointer &);
163-
164162
void RecordReadOwn(const ItemPointer &);
165163

166164
void RecordUpdate(const ItemPointer &);

0 commit comments

Comments
 (0)