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

Skip adding READs to the RWSet #1425

Merged
merged 2 commits into from
Jun 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/concurrency/timestamp_ordering_transaction_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ bool TimestampOrderingTransactionManager::PerformRead(TransactionContext *const
return true;

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

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

} else {
Expand Down Expand Up @@ -316,8 +314,6 @@ bool TimestampOrderingTransactionManager::PerformRead(TransactionContext *const
// then attempt to set last reader cid.
if (SetLastReaderCommitId(tile_group_header, tuple_id,
current_txn->GetCommitId(), false) == true) {
// update read set.
current_txn->RecordRead(location);
return true;
} else {
// if the tuple has been owned by some concurrent transactions,
Expand Down
21 changes: 3 additions & 18 deletions src/concurrency/transaction_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,35 +94,20 @@ RWType TransactionContext::GetRWType(const ItemPointer &location) {
return RWType::INVALID;
}

void TransactionContext::RecordRead(const ItemPointer &location) {
PELOTON_ASSERT(rw_set_.find(location) == rw_set_.end() ||
(rw_set_[location] != RWType::DELETE &&
rw_set_[location] != RWType::INS_DEL));
auto rw_set_it = rw_set_.find(location);
if (rw_set_it != rw_set_.end()) {
return;
}
rw_set_[location] = RWType::READ;
}

void TransactionContext::RecordReadOwn(const ItemPointer &location) {
PELOTON_ASSERT(rw_set_.find(location) == rw_set_.end() ||
(rw_set_[location] != RWType::DELETE &&
rw_set_[location] != RWType::INS_DEL));
rw_set_[location] = RWType::READ_OWN;
is_written_ = true;
}

void TransactionContext::RecordUpdate(const ItemPointer &location) {
PELOTON_ASSERT(rw_set_.find(location) == rw_set_.end() ||
(rw_set_[location] != RWType::DELETE &&
rw_set_[location] != RWType::INS_DEL));
auto rw_set_it = rw_set_.find(location);
if (rw_set_it != rw_set_.end() && (rw_set_it->second == RWType::READ ||
rw_set_it->second == RWType::READ_OWN)) {
rw_set_it->second = RWType::UPDATE;
is_written_ = true;
}
PELOTON_ASSERT(is_written_);
rw_set_[location] = RWType::UPDATE;
is_written_ = true;
}

void TransactionContext::RecordInsert(const ItemPointer &location) {
Expand Down
2 changes: 0 additions & 2 deletions src/include/concurrency/transaction_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ class TransactionContext : public Printable {
index_oid, DDLType::DROP));
}

void RecordRead(const ItemPointer &);

void RecordReadOwn(const ItemPointer &);

void RecordUpdate(const ItemPointer &);
Expand Down