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

Flaw in attempt page update, breaks some attempts, huge performance hit

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.3.1
    • Fix Version/s: 2.3.2
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide

      1. Attempt a multi-page quiz as a student.

      2. From some page in the middle, click 'Finish attempt...'

      3. Then click 'Return to attempt' and make sure you go back to the page you were on.

      4. If you can be bothered, look directly in the DB, and verify that quiz_attempts.currentpage is only being changed for the current attempt, not for all attempts!

      Show
      1. Attempt a multi-page quiz as a student. 2. From some page in the middle, click 'Finish attempt...' 3. Then click 'Return to attempt' and make sure you go back to the page you were on. 4. If you can be bothered, look directly in the DB, and verify that quiz_attempts.currentpage is only being changed for the current attempt, not for all attempts!
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:

      Description

      New logic was added in 2.3 that sets the attempt page if it doesn't match, but the updates happens unconditionally, so all attempt pages are set to the page of the current attempt, which then means every other attempt will do this too when visited, causing a vicious cycle.

      On large sites, this means that you have a very large update whenever and attempt is done. On postgres, this causes tons of dead records (we had over 20 million, they were being made faster than vaccum could keep up). The updates would cause the attemps to timeout, because it was updating so many records. The fix is to include the missing parameters for the set_field call in mod/quiz/attempt.php

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timhunt Tim Hunt
              Reporter:
              emerrill Eric Merrill
              Integrator:
              Dan Poltawski
              Tester:
              Rajesh Taneja
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Sep/12