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

Restore queries many items from file table when it needs one

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.6.4, 2.7.1
    • 2.6.3, 2.7, 2.8
    • Backup
    • MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • MDL-46079-master
    • 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.
    • 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.

      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.

            quen Sam Marshall
            quen Sam Marshall
            Dan Poltawski Dan Poltawski
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Andrew Lyons Andrew Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.