[PATCH] A customer reported strange locking behavior with TokuDB


Customer reports the following:

"We have uncovered a locking issue that doesn't "look right" to me. Here's how to reproduce it (I can send you a VM with all this setup if needed).

1) Create and populate the sysbench sbtest1 table as a TokuDB table.
2) Run a benchmark (any kind is fine...even a single-threaded one will do).
3) Issue "create temporary table temp1 as select id from sbtest1;" or "insert into temp1 select id from sbtest1;" in a different session..
4) Check the processlist in a 3rd session...you'll see that sbtest1 is locked from any insert/update/delete activity while the "select id from sbtest1" in step #3 runs.

This only happens if log-bin is set to a value (ie. binlogging is turned on).

This behavior happens whether the default transaction isolation is read-comitted, read-uncommitted, repeatable-read, or serializable....it should only happen with serializable. This behavior does NOT happen if the selected table is InnoDB, only if it's TokuDB. And again, this only happens if binlogging is on (which it must be for replication and disaster recovery)...if we turn binlogging off, the locks don't appear."

The customer has a VM that duplicates issue if that is of help. I can be point of contact with them as required. - Jon


Issue related to TokuDB


Sergei Golubchik


Jonathan Day





Fix versions

Affects versions