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

Automated backup course ordering

    XMLWordPrintable

    Details

    • Database:
      Any
    • Testing Instructions:
      Hide

      This is best tested by running the automated backup from the command line. i.e.

      php admin/tool/task/cli/schedule_task.php --execute='\core\task\automated_backup_task'
      

      Test 1:
      1. Enable automated backups in your Moodle site
      2. Disable disable backup_auto_skip_modif_days and backup_auto_skip_modif_prev in admin, so there aren't skipped courses.
      3. Create 3 test courses in Moodle
      4. Run the backup

      Expected result:
      The courses should be backed up (or skipped) from most recently modified to least recently modified.

      Test2:
      1. Add a new (fourth) course to your Moodle
      2. Advance your system clock 2 weeks to the future (to ensure that next schedule time is past).
      2. Run the backup

      Expected result:
      The new course should be backed up first. It should then be followed by the other 3 courses with the course with the oldest backup time first.

      Note that it's not important if the course is backup or skipped, only the order they are processed is.

      Show
      This is best tested by running the automated backup from the command line. i.e. php admin/tool/task/cli/schedule_task.php --execute= '\core\task\automated_backup_task' Test 1: 1. Enable automated backups in your Moodle site 2. Disable disable backup_auto_skip_modif_days and backup_auto_skip_modif_prev in admin, so there aren't skipped courses. 3. Create 3 test courses in Moodle 4. Run the backup Expected result: The courses should be backed up (or skipped) from most recently modified to least recently modified. Test2: 1. Add a new (fourth) course to your Moodle 2. Advance your system clock 2 weeks to the future (to ensure that next schedule time is past). 2. Run the backup Expected result: The new course should be backed up first. It should then be followed by the other 3 courses with the course with the oldest backup time first. Note that it's not important if the course is backup or skipped, only the order they are processed is.
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull Master Branch:
      master_MDL-65201_Automated_backup_course_ordering

      Description

      Currently there is no forced order when getting the initial list of courses to be processed by automated backups. Not having a sort doesn't make the select random, instead the list of courses will tend to be always backed up in the same (albeit arbitrary) order.

      This can lead to some undesirable behavior. Where the same courses are always backed up and some courses are rarely backed up.
      This is best manifested in big sites where there are a lot of courses and a lot of change happening. And in situations where the automated backup process gets interrupted, or aborts.

      This patch addresses this by applying some ordering to the way courses are backed up. It sets the following preference:

      • Backup courses that do not have an entry in backup_courses first, as they are likely new and never been backed up.
      • Backup courses that have the oldest next start time in backup_courses.
      • Give preference to most recently modified courses over other courses.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Nov/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours, 30 minutes
                  4h 30m