Issue Details (XML | Word | Printable)

Key: MDL-11946
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Eloy Lafuente (stronk7)
Reporter: Heinz-Günter Kuper
Votes: 3
Watchers: 5
Operations

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

MySQL Database not correctly upgraded from Moodle 1.6.4 to 1.8.2.

Created: 29/Oct/07 10:50 PM   Updated: 13/Nov/07 09:12 AM
Return to search
Component/s: Database SQL/XMLDB
Affects Version/s: 1.8.2
Fix Version/s: 1.8.4, 1.9

File Attachments: 1. File Comparison_MoodleDB_1.8.ods (103 kB)
2. Microsoft Excel Comparison_MoodleDB_1.8.xls (434 kB)

Environment: PHP 5, MySQL 5
Issue Links:
Blockers
 

Database: MySQL
Participants: Eloy Lafuente (stronk7), Heinz-Günter Kuper, Martin Dougiamas and Petr Skoda
Security Level: None
Resolved date: 13/Nov/07
Affected Branches: MOODLE_18_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
We upgraded from Moodle 1.6.4 to Moodle 1.8.2 about a month ago and have been having major performance issues since then. Our semester started last week and, with the influx of new students, the load on our Moodle increased exponentially. We had noticed that the database queries seemed somewhat inefficient and eventually the load reached a point where our database became completely deadlocked. Users kept getting database connection errors and were unable to use the system in any way.

In our attempts to solve the problem we swapped to a new server, installed the latest versions of MySQL 5 and PHP 5 and tested everything running Apache 1.3 and Apache 2.2 without any improvement. We also updated to Moodle 1.8.3+, but did not notice any performance enhancements.

The major issues, as far as we can tell, are:
1. The upgrade scripts are severely defective: fields were not correctly initialised, keys were not created. We established this by comparing the database table structure of our Moodle with a fresh, 'vanilla' install of Moodle. The create table statements of the fresh install were markedly different to those used by the upgrade scripts. For example, the order of some table columns in a fresh Moodle install are different to those generated in an existing database by the upgrade scripts.
2. The entire database became deadlocked due to damaged or missing indices (another side effect of the defective upgrade scripts): Moodle queries were locking tables in the database faster than the MySQL daemon could free them. This also caused data corruption in the database.

In the attachments (same content, one in Open Office format and one in MS Excel) you will find a comparison between existing tables after an upgrade and the tables after a clean install of Moodle. Items in red are missing, items in green are swapped.

More information can be found in the moodle.org General Problems Forum:
http://moodle.org/mod/forum/discuss.php?d=83216

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Ralf Hilgenstock made changes - 29/Oct/07 11:08 PM
Field Original Value New Value
Link This issue is blocked by MDL-11947 [ MDL-11947 ]
Martin Dougiamas made changes - 13/Nov/07 09:12 AM
Fix Version/s 1.8.4 [ 10242 ]
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 1.9 [ 10190 ]
Resolution Fixed [ 1 ]