Skip to content

Commit

Permalink
treat txn w/ no modifying queries as read-only (cmu-db#1396:4)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmwnshn committed Jun 11, 2018
1 parent e0a9348 commit 8b1531b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/concurrency/timestamp_ordering_transaction_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,14 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
//// handle other isolation levels
//////////////////////////////////////////////////////////

auto &rw_set = current_txn->GetReadWriteSet();

// if no modifying queries, treat as read-only
if (rw_set.empty()) {
EndTransaction(current_txn);
return ResultType::SUCCESS;
}

auto storage_manager = storage::StorageManager::GetInstance();
auto &log_manager = logging::LogManager::GetInstance();

Expand All @@ -631,7 +639,6 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
// generate transaction id.
cid_t end_commit_id = current_txn->GetCommitId();

auto &rw_set = current_txn->GetReadWriteSet();
auto &rw_object_set = current_txn->GetCreateDropSet();

auto gc_set = current_txn->GetGCSetPtr();
Expand Down

0 comments on commit 8b1531b

Please sign in to comment.