-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
#project4, In the Insert executors, when I tried to maintain the write sets in transactions, the Abort() method returned me an error.
Then I found it occur because the TableWriteRecord was already added to write sets by TableHeap::InsertTuple() method, as well as TableHeap::MarkDelete() and TableHeap::UpdateTuple(). So when I called AppendTableWriteRecord(const TableWriteRecord &write_record), the same record will be added twice.
> bool TableHeap::InsertTuple(const Tuple &tuple, RID *rid, Transaction *txn) {
...
// Update the transaction's write set. **problem code is here**
txn->GetWriteSet()->emplace_back(*rid, WType::INSERT, Tuple{}, this);
return true;
}That's not so reasonable for me. I thought maintaining TableWriteRecord and IndexWriteRecord both in write sets, but now only the IndexWriteRecord needs to do. Hope it can be improved.
Metadata
Metadata
Assignees
Labels
No labels