-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deadlock issues with searchindex element save #3197
Comments
Is this MySQL or PostgreSQL? Any chance you could send a database dump over to [email protected] and point us to some entries we could save to try and reproduce? |
It's MySQL (on AWS RDS). Yep, I'll send it over. |
@angrybrad sent a DB dump and step to reproduce! |
Any updates on this? We are also experiencing deadlock issues related to "INSERT INTO searchindex". |
@larsboldt nothing yet, I pinged @angrybrad a couple days ago and he said it was till on his plate, though. |
I receive a similar issue on some requests when rebuilding the search index.
|
@ccchapman a few months back I was working with @angrybrad and he was able to reproduce it with my environment. After you it happens once on a particular entry, if you save that same entry again, does it still occur? I think in our case, once the error occurred it wouldn't again for that same entry. @angrybrad gave me some Mysql settings to play with to see if I could recreate, which I haven't tried yet. I'll try and do that next week. |
@ccchapman I haven't had any success, but I can confirm that for me at least, this only seems to happen once per entry. After the exception is thrown, if I resave the same entry, all is well. |
@timkelty For me it occurred when rebuilding the search index. Happened 50 times during a clear (through the ajax requests.) Not sure if expected. |
I'm also experiencing this issue semi-regularly in a multi-site setup. |
Have a potential fix for this here if someone who is able to reproduce would like to test. You can change your composer.json to this to pull it in, then
|
@angrybrad I was able to consistently reproduce the issue by rebuilding the search index and attempting to re-save an entry. Updating and testing the change seems to resolve the issue for me, though my error had not been a result of specifically rebuilding search indexes. |
@jsunsawyer, et. al – Brad's fix remedied this for me! Haven't seen a deadlock error where I could consistently reproduce before. 🤞 |
Glad to hear! |
Could we get the change in the 3.1 branch, please? Not willing to update to a beta / major version to get this fixed just yet. Cheers |
@brandonkelly Sorry my bad, I must have missed it. Unfortunately, that means this bug is not fixed... I am testing 3.1.31 with commerce 2.1.2 and running 50VUs to load test my app and create orders end up with dead locks.
I've narrowed it down to https://github.com/craftcms/cms/blob/3.1.31/src/services/Search.php#L113 after disabling most of my fields to be indexed in the search. Commenting out line https://github.com/craftcms/cms/blob/3.1.31/src/services/Search.php#L113 and https://github.com/craftcms/cms/blob/3.1.31/src/services/Search.php#L116 will completely remove the dead lock issue. Reason I'm mentioning commerce is because it would throw the deadlock for fields you cannot edit in the CMS and we had to implement an event hook to change the searched attributes:
and running a load test for a commerce app is more than common :) @angrybrad FYI |
Hi, Any news with this, please? This dead lock issue is becoming really critical now for us. Even without considering a high load, this is now being triggered when two tasks run simultaneously... Cheers Craft 3.1.31 |
@my2ter Craft 3.2.0 RC3 offloaded updating search indexes on an element save to a job in the queue (https://github.com/craftcms/cms/blob/3.2/CHANGELOG-v3.md#320-rc3---2019-07-02) along with several other performance improvements in the element saving pipeline and 3.2 will likely be GA in the next week or two. Any chance you could try to reproduce on the 3.2 branch? To test, change your "require": {
"craftcms/cms": "^3.2.0-RC3",
"...": "..."
} Then run |
Working on an app and consistently getting Deadlock errors on element save.
I can reproduce this at will by opening up 3 or more entries and saving them all.
Past deadlock issues: #3003
Potentially relevant factors:
Here's the trace:
The text was updated successfully, but these errors were encountered: