Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAvoid "The total number of locks exceeds the lock table size" error #335
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stig
Nov 16, 2015
Contributor
I admit I have no idea what the hell is going on there. It shouldn't make a difference, but it does.
|
I admit I have no idea what the hell is going on there. It shouldn't make a difference, but it does. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stig
Jan 12, 2017
Contributor
Ping! If this fix is not something you're interested in, please just close the PR so it doesn't clog up my list of open PRs any more.
|
Ping! If this fix is not something you're interested in, please just close the PR so it doesn't clog up my list of open PRs any more. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
sodabrew
Jan 13, 2017
Owner
I found someone else describing the same problem with the last batch (where the number of matching records is below the limit value): http://stackoverflow.com/a/23751982
This feels like a strange MySQL-ism that may have been fixed in the later 5.x releases?
At any rate, the patch is reasonable, and the number of records that might be left behind isn't much consequence, as large sites may have many tens of thousands of records to prune daily.
Apologies I've not kept up with the PRs here for quite some time.
|
I found someone else describing the same problem with the last batch (where the number of matching records is below the limit value): http://stackoverflow.com/a/23751982 This feels like a strange MySQL-ism that may have been fixed in the later 5.x releases? At any rate, the patch is reasonable, and the number of records that might be left behind isn't much consequence, as large sites may have many tens of thousands of records to prune daily. Apologies I've not kept up with the PRs here for quite some time. |
stig commentedNov 16, 2015
I was experiencing this error when running the
reports:prunetask:Every time it gets almost to the end, then failing on the last batch. Doesn't matter if there's millions of rows to be deleted or a couple thousand. Logging in and attempting to run the delete by hand yields the same result. Reducing the limit to 100 makes the query execute instantly, several times, until there's less than 100 rows to delete again, when it breaks. Same for setting the limit to 10. I eventually manage to delete all the rows by reducing the limit to 1, and running it repeatedly. However, running the
reports:prunetask again immediately still fails. (This table grows fast!)I tried to increase the
innodb_buffer_pool_sizeten-fold, as described here but to no avail. Attempting to delete by hand reveals:It looks like, for this table only that MySQL is really not liking to have a limit that is bigger than the number of rows to be deleted. So, I applied this change: https://github.com/sodabrew/puppet-dashboard/pull/335/files -- and now it succeeds! Sure, it leaves a few orphaned rows on each run, but those will be cleaned up on the next run.
My the way, I'm using
mysql_config --version5.1.73.