Issue Details (XML | Word | Printable)

Key: MDL-18359
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Martín Langhoff
Reporter: Jo Matthews
Votes: 3
Watchers: 3
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Daily statistics not being gathered

Created: 24/Feb/09 07:00 PM   Updated: 24/Feb/09 07:00 PM
Return to search
Component/s: Performance
Affects Version/s: 1.9.3
Fix Version/s: None

Environment:
Apache/2.2.6 (Unix)
MySQL 5.0.22

Database: MySQL
Participants: Jo Matthews and Martín Langhoff
Security Level: None
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
The gathering of daily statistics during the cron job after we upgraded from moodle 1.9 to 1.9.3 is no longer working. If I run the cron job in the browser it shows:

Running daily statistics gathering, starting at 1233705600:
...

After leaving it running for a number of hours users began to complain that they couldn't log in. I checked the process list and found this query running:

INSERT INTO mdl_stats_daily (stattype, timeend, courseid, roleid, stat1, stat2)

                SELECT 'enrolments', timeend, courseid, roleid, COUNT(DISTINCT userid), 0
                  FROM (
                           SELECT 1233792000 AS timeend, pl.courseid, pl.roleid, pl.userid
                             FROM (
                                      SELECT DISTINCT ra.roleid, ra.userid, c.id as courseid
                                        FROM mdl_role_assignments ra JOIN mdl_context ctx
                  ON ctx.id = ra.contextid
             CROSS JOIN mdl_course c
             JOIN mdl_role_capabilities rc
                  ON rc.roleid = ra.roleid LEFT OUTER JOIN mdl_course_categories cc1
                            ON cc1.id = c.category
                                       WHERE ((rc.capability = 'moodle/course:view' )
               AND rc.permission = 1 AND rc.contextid = 1
               AND (ctx.contextlevel = 10
                    OR (c.id = ctx.instanceid AND ctx.contextlevel = 50) OR (cc1.id = ctx.instanceid AND ctx.contextlevel = 40)))
                                   ) pl
                       ) inline_view
              GROUP BY timeend, courseid, roleid

and there was a list queries that were waiting because the tables were locked.
Once I had killed the process moodle was ok but obviously no stats had been gathered. There is a forum post that seems to be related to the same issue http://moodle.org/mod/forum/discuss.php?d=103883.

Before upgrading statistics were working fine. For now I have disabled the gathering of statistics and the cron job completes but we need this feature for producing our monthly reports.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.