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

expired_retention_period scheduled task not working on larger moodles

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_36_STABLE, MOODLE_39_STABLE
    • 10

      We are preparing our Moodle installation for a summer upgrade to 3.6.x - currently I am running 3.6.2.  We are upgrading from 3.2, and running on Linux/MySQL.  Our test server, where 3.6 is currently sitting, is not production standard but reasonably well resourced.  In general, Moodle runs well on it.

       

      We are a large Moodle, with thousands of courses and tens of thousands of users - albeit not all active. 

       

      One of the new features we are particularly looking forward to using is the new Data Privacy/Retention/GPDR admin component.

       

      However, I am having problems, particularly when attempting to run the "Expired retention period \tool_dataprivacy\task\expired_retention_period" scheduled task.

       

      The database snarls up and brings down the entire site.  This query runs and runs ... and runs.  It never seems to resolve.

       

              $sql = "SELECT $fields

                        FROM

      {[context|https://moodle.org/mod/glossary/showentry.php?eid=9984&displayformat=dictionary]}

      ctx

                        JOIN (

                              SELECT c.enddate AS expirydate, subctx.path

                                FROM {context} subctx

                                JOIN {course} c

                                  ON subctx.contextlevel = :contextlevel

                                 AND subctx.instanceid = c.id

                                 AND c.format != 'site'

                             ) ctxcourse

                          ON ctx.path LIKE {$parentpath} OR ctx.path = ctxcourse.path

                   LEFT JOIN {tool_dataprivacy_ctxinstance} dpctx

                          ON dpctx.contextid = ctx.id

                   LEFT JOIN {tool_dataprivacy_ctxexpired} expiredctx

                          ON ctx.id = expiredctx.contextid

                       {$where}

                    ORDER BY ctx.path DESC";

       

       

      Is anybody else having similar issues?  Does anybody know how to resolve it?  My feeling is that for bigger Moodle, a flatter, less clever but also less nested series of queries might be better - but I'd really like other people's view.   Is there work going on in this area?

       

      Any help/insights would be hugely welcome. 

            Votes:
            25 Vote for this issue
            Watchers:
            48 Start watching this issue

              Created:
              Updated:

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