Search code examples
mariadbtokudb

tokuDb setting for time to timesout a statement


In a mariadb table with tokuDb engine; I am ecountering the below error - either on a delete statement; whilst there is a background insert load, and vice versa.

Lock wait timeout exceeded; try restarting transaction

Does tokuDb user a setting that can be updated to determine how long it waits before it timesout a statement?

I couldn't find the answer in tokuDb documents. The maria varaible is still at its default value: 'lock_wait_timeout', '31536000' -- but my timeout is coming back in quite a bit less than a year. The timeouts are coming during a load test; and I haven't spotted a time value in the error - but it feels like a few seconds; to minutes at the most before the timeout is thrown.

Thanks, Brent


Solution

  • TokuDB has its own timeout variable, tokudb_lock_timeout, it is measured in milliseconds and has the default value 4000 (4 seconds), which fits your observations. It can be modified both on the session and global levels, and can also be configured in the .cnf file.

    Remember that when you set a global value for a variable which has both scopes, it only affects future sessions (connections), but not the existing ones.

    -- for the current session
    SET SESSION tokudb_lock_timeout = 60000;
    
    -- for future sessions
    SET GLOBAL tokudb_lock_timeout = 60000;