Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.4.11, 2.6.6, 2.7.3, 2.8.1
-
Component/s: Backup, Course completion
-
Testing Instructions:
-
Affected Branches:MOODLE_24_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
-
Fixed Branches:MOODLE_27_STABLE, MOODLE_28_STABLE
-
Pull from Repository:
-
Pull Master Branch:
MDL-46651-master-restore-course-completion-duplicate-key
Description
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