-
Bug
-
Resolution: Fixed
-
Minor
-
2.4.11, 2.6.6, 2.7.3, 2.8.1
-
MOODLE_24_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
MDL-46651-master-restore-course-completion-duplicate-key -
Course restore fails when restoring a large-ish course containing user completion data. I have a large course backup (18mb) that takes a few minutes to restore. If I restore it with user data then the restore fails with the error in the screen shot attached.
I am assuming this is because cron completion calculations cause a race condition between the time the existing record is queried and the insert happens here:
https://github.com/moodle/moodle/blob/master/backup/moodle2/restore_stepslib.php#L3312-L3327
This seems to be similar to MDL-30466