This repository was archived by the owner on Sep 27, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -623,15 +623,14 @@ ResultType TimestampOrderingTransactionManager::CommitTransaction(
623
623
// // handle other isolation levels
624
624
// ////////////////////////////////////////////////////////
625
625
626
- auto &rw_set = current_txn->GetReadWriteSet ();
627
-
628
- // if no modifying queries, treat as read-only
629
- if (rw_set.empty ()) {
630
- LOG_TRACE (" Empty RW set, ending transaction." );
626
+ if (!current_txn->IsWritten ()) {
627
+ LOG_TRACE (" Transaction not yet written, ending transaction." );
631
628
EndTransaction (current_txn);
632
629
return ResultType::SUCCESS;
633
630
}
634
631
632
+ auto &rw_set = current_txn->GetReadWriteSet ();
633
+
635
634
auto storage_manager = storage::StorageManager::GetInstance ();
636
635
auto &log_manager = logging::LogManager::GetInstance ();
637
636
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ void TransactionContext::RecordReadOwn(const ItemPointer &location) {
112
112
(rw_set_[location] != RWType::DELETE &&
113
113
rw_set_[location] != RWType::INS_DEL));
114
114
rw_set_[location] = RWType::READ_OWN;
115
+ is_written_ = true ;
115
116
}
116
117
117
118
void TransactionContext::RecordUpdate (const ItemPointer &location) {
Original file line number Diff line number Diff line change @@ -266,6 +266,13 @@ class TransactionContext : public Printable {
266
266
*/
267
267
bool IsReadOnly () const { return read_only_; }
268
268
269
+ /* *
270
+ * @brief Determines if already written.
271
+ *
272
+ * @return True if already written, False otherwise.
273
+ */
274
+ bool IsWritten () const { return is_written_; }
275
+
269
276
/* *
270
277
* @brief Gets the isolation level.
271
278
*
You can’t perform that action at this time.
0 commit comments