MySQLOnRocksDB/mysql-5.6
forked from facebook/mysql-5.6

Loading…
Release Row Locks when necessary, Transaction API variant #105
Closed
spetrunia opened this Issue
· 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MyRocks needs to release row locks in some cases:
All locks are recursive. A lock may be acquired multiple times. When MyRocks wants to release locks taken by the statement, it only means un-doing the locking actions done by this statement. All the locking done before the last statement must remain.
Releasing locks for failed statement
(Current implementation in MyRocks was done in issue #57).
When a statement inside a transaction fails, MyRocks will make these calls:
As far as I understood Antony @agiardullo 's suggestion, it was:
This will work.
Release of the last acquired lock
This is used to release the lock that was obtained when reading the last row. From MyRocks point of view, it is sufficient if this
TransactionDBImpl's function was exposed inTransactionDBclass:MyRocks always knows which Column Family was used, and the key is saved in
ha_rocksdb::last_rowkey.However, current implementation in TransactionDBImpl::UnLock is not sufficient. As far as I understand it is not recursive: one can call TryLock() multiple times, and then a single UnLock() call will fully release the lock. MyRocks needs last UnLock() call to only undo the effect of the last TryLock() call.