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

Restore queries many items from file table when it needs one

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.3, 2.7, 2.8
    • Fix Version/s: 2.6.4, 2.7.1
    • Component/s: Backup
    • Labels:
    • Testing Instructions:
      Hide

      Note: This test doesn't fail before the change - making it fail is hard and would require you to create a very large number of identical files for testing. The test just exercises the modified code.

      1. You need a File resource, so create one if necessary.
      2. Duplicate the resource. (This causes the system to create a backup without files, which is the code branch that previously had the problem.)
      3. Click on the duplicated resource to check the file downloads correctly.

      Show
      Note: This test doesn't fail before the change - making it fail is hard and would require you to create a very large number of identical files for testing. The test just exercises the modified code. 1. You need a File resource, so create one if necessary. 2. Duplicate the resource. (This causes the system to create a backup without files, which is the code branch that previously had the problem.) 3. Click on the duplicated resource to check the file downloads correctly.
    • Workaround:
      Hide

      The workaround is to use a method that doesn't create a backup without files, i.e. do a normal full backup and restore.

      Show
      The workaround is to use a method that doesn't create a backup without files, i.e. do a normal full backup and restore.
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-46079-master

      Description

      There is a point in restore (without files) where it queries for all items in the files table which have a certain content hash, even though it actually only uses one item from the resulting array.

      In our live system this is running out of memory for a certain case (I presume it's a zero-byte file or something so there are absolutely kajillions of them).

      This can be easily fixed by limiting the query to return only one item, unless I'm missing something.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Jul/14