Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-74818

Restoring a course can be slow if you have a lot of courses "Course restoration in progress copie"

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.9.14, 3.10.11, 3.11.7, 4.0.1, 4.1
    • None
    • Backup
    • None
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • Hide
      1. Start by importing a course
      2. At the category selection stage, select a category and click on "next"
      3. On the next screen, click on the "back" button of your browser. At this stage an "Course restoration in progress copie X" line has been created and not deleted.
      4. Repeat all of these steps multiple times to produce lots of lines.
      5. The more the previous steps are repeated, the longer the time between step 2 and 3 will become until triggering timeouts in my case.
      Show
      Start by importing a course At the category selection stage, select a category and click on "next" On the next screen, click on the "back" button of your browser. At this stage an "Course restoration in progress copie X" line has been created and not deleted. Repeat all of these steps multiple times to produce lots of lines. The more the previous steps are repeated, the longer the time between step 2 and 3 will become until triggering timeouts in my case.

    Description

      If you start the import of a course, but stop just after the category selection page and you quit this import without pressing the "cancel" button, then in base there will remain a course with the name "Course restoration in progress copie X", with X is a counter.
      If this operation is repeated hundreds of times, we end up with hundreds of lines in the base for nothing.

      The more lines there are, the longer the import phase between the selection of the category and the next page will be, because this is when the new name is generated in "Course restoration in progress copie X" format. Indeed to find the right value of the counter at the end of the name, moodle will make two requests on each possible value of the counter until you find the right value.

      On my production moodle in 3.9, we had more than 800 courses with a name in the format "Course restoration in progress copie X". Moodle must then make more than 1600 requests to find the right name and this slows down the import enormously, or even triggers timeouts.

      I also tested this on a moodle platform in main branch to find that the problem is still present although less impacting.

      Attachments

        Activity

          People

            Unassigned Unassigned
            lvillanne-recia Loïc Villanné
            Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: