-
Notifications
You must be signed in to change notification settings - Fork 624
Concurrency control (MVTO) discussion #1420
Comments
Hi @mbutrovich, nice thought! Most of the problems you mentioned above have been discussed before. You can find my answers below.
I am open to discuss any of these issues, and please let me know if there's anything I can help with. Hope my answers help :-) |
…ses parts 5 and 6 of cmu-db#1420.
* Set LastReaderCommitId on insert, update, and delete versions. Addresses parts 5 and 6 of #1420.
* Set LastReaderCommitId on insert, update, and delete versions. Addresses parts 5 and 6 of cmu-db#1420.
In trying to improve the performance of the CC system, I've identified several design decisions that I'd like to discuss here and possibly change in the future.
...and our own wiki entry on our CC protocol:
We add READs to a TransactionContext's RWSet. One of Read-Only TxnContext Interface; Read-Only (single-statement select, txn) optimizations #1402's changes tries to optimize around this, but really it shouldn't be done in the first place. I understand the need to add READ_OWNs since we need to release the write lock on a tuple at transaction end, but a normal READ shouldn't be there.Addressed in Skip adding READs to the RWSet #1425.Our tuple header is "full" at 64 bytes. We could always make the reserved field larger if we needed to, but spilling such a heavily-accessed structure beyond a single cache line sounds bad to me. Removing the doubly-linked version chain would buy us some space, as would exploring atomic operations on timestamps to remove the SpinLatch. I'm not convinced the latter is possible, but I am experimenting with 128-bit CAS implementations.
Reusing owned tuple slots for updates and deletes seems like a premature optimization that sacrifices correctness. As currently implemented, if we repeatedly update a tuple within a single transaction and then abort, we do not have enough information to reconstruct the old versions that need to be pruned from the indexes. If we stick with reusing tuple slots, then it seems like we need more info added to the TransactionContext, like index write sets (or wait for logging).
Also related to reusing owned tuple slots, I can generate an assertion failure in the master branch (debug mode) with the following SQL:Addressed in Set LastReaderCommitId on new versions #1429.This is similar to #1336 and #1337.
We don’t set the last-reader timestamp of a new version to the writer's timestamp. Instead it is 0. This goes against all of the MVTO references I've found, and may be a contributor to issue 5 listed above.Addressed in Set LastReaderCommitId on new versions #1429.Hybrid index scan is fiddling with CC stuff. This strikes me as legacy code from before we had a proper CC system since it's from 2016. Based on Coveralls it doesn't seem like we exercise this codepath anyway, but anyone outside of the CC system changing tuple headers jumps out at me as concerning.
I'd like to have a discussion on these topics and if necessary come to a conclusion on how to address them.
@yingjunwu @gandeevan
The text was updated successfully, but these errors were encountered: