Status: Waiting for peer review
Affects Version/s: 3.7
Fix Version/s: None
I don't think it's reasonable to re-create the bug in a testing environment. You'd need ~70,000 random rows in mdl_event table, plus traffic. Confirm that the index is created in both the installation and upgrade scenarios is probably enough.
Pull from Repository:
Pull Master Branch:MDL-66603-master
Pull Master Diff URL:
In some cases, creating an assignment with 'remind me to grade by' unchecked fails with the following error:
Debug info: Deadlock found when trying to get lock; try restarting transaction
DELETE FROM mdl_event WHERE modulename = ? AND instance = ? AND eventtype = ?
0 => 'assign',
1 => '53500',
2 => 'gradingdue',
Error code: dmlwriteexception
line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
line 1625 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 1911 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->delete_records_select()
line 1227 of /mod/assign/locallib.php: call to moodle_database->delete_records()
line 702 of /mod/assign/locallib.php: call to assign->update_calendar()
line 41 of /mod/assign/lib.php: call to assign->add_instance()
line 124 of /course/modlib.php: call to assign_add_instance()
line 154 of /course/modedit.php: call to add_moduleinfo()
We're currently running 3.7.1+, but have seen this issue since about 3.3.x. It's intermittent, occuring during busy times.