Import creating 1 million+ sections

Issue #45 resolved
Tristan daCosta created an issue

This has been discussed in another thread (https://bitbucket.org/dw8/moodle-format_tiles/issues/39/39-activity-chooser) but requires its own so that we can address this bug as a seperate issue.

Moodle 3.9.1 (Build: 20200713)

Tiles 3.9.0.1 (Beta) 2020080600

I’m still not sure how to replicate this behaviour, but it may occur when importing into a course with ‘Tiles’ enabled from a course with ‘Tiles’ enabled.

Import process appears to get stuck around 90% mark and will eventually time out. The ‘new’ course becomes inaccessible. Looking in the table ‘_course_sections’, you will see potentially 1 million+ rows for the course in question.

A user on the linked issue above witnessed 800,000+ rows per course, whereas I am seeing 1,082,485 per course. This process must be hitting a limit in MySQL so is unique to your installation.

In the meantime, I have disabled, and encourage anyone else on Moodle 3.9 to disable this until a patch is found.

Hopefully a fix comes around soon.. have my fingers crossed.

Comments (4)

  1. David Watson repo owner

    I have posted a new release for Moodle 3.9 (3.9.0.2 Beta 2020080602) which should detect any section issue, stopping the user from proceeding and avoiding the issue.

    For now, the error message will also state which section is causing the problem, so that the user can delete the section from the course themselves and proceed if they wish. In the next release, we can fix the section error behind the scenes. so that an error message is not required and the process can complete.

    Having looked at the background, this arises when:

    • you are using Moodle 3.9
    • the incompatible Moodle 3.7 version of the plugin was previously installed and used in Moodle 3.9
    • you have a course which became affected by issue #39 as a result of the above
    • you then try to import into that course, or you back it up and try to restore it

  2. Tristan daCosta reporter

    Thanks for your support David. I can confirm that the issue that this stems from has been addressed in the 3.9 Beta version.

    Important information that David has provided me with is to ensure you have no courses with HIGH section number (would have been created pre-update). If importing from a course which has one of these unusually high section numbers, Moodle’s import process will fill in the gaps and create that many sections in the target course, making that course (and possibly the site) inaccessible until the additional sections are removed.

    Thanks again.

  3. Heena Agheda

    Hi @David Watson ,
    Thank you for latest release for moodle39. I have updated code to latest and run tests, there are only 2 tests failing

    5) format_tiles_course_courselib_testcase::test_course_delete_module with data set "quiz" ('quiz', array(1598252833))
    Failed asserting that '' matches PCRE pattern "/This category has been deleted because, after deleting the course, its questions weren't used any more./".
    
    /siteroot/lib/phpunit/classes/advanced_testcase.php:80
    
    To re-run:
     vendor/bin/phpunit "format_tiles_course_courselib_testcase" course/format/tiles/tests/format_tiles_courselib_test.php
    
    6) format_tiles_course_courselib_testcase::test_course_module_created_event
    Failed asserting that core\event\grade_item_updated Object (...) is an instance of class "\core\event\course_module_created".
    
    /siteroot/course/format/tiles/tests/format_tiles_courselib_test.php:2247
    /siteroot/lib/phpunit/classes/advanced_testcase.php:80
    
    To re-run:
     vendor/bin/phpunit "format_tiles_course_courselib_testcase" course/format/tiles/tests/format_tiles_courselib_test.php
    

    Is there any plan to fix in next release?
    Thanks again,
    Heena

  4. David Watson repo owner

    For anyone affected by this issue, the latest version of the plugin for Moodle 3.9 includes an experimental tool to help you to fix it. You can access the tool Under Site Administration > Plugins > Course formats > Tiles format > Other > Problem courses

    @Heena Agheda the unit tests are passing for me but let me know if you still have an issue

  5. Log in to comment