Skip to content

Concurrency control for insert executors problem #211

@Sunlly0

Description

@Sunlly0

#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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions