Mahara 15.04.3 upgrade issues

Bug #1499568 reported by Yaju Mahida
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Unassigned
15.04
Fix Released
High
Unassigned
15.10
Fix Released
High
Unassigned

Bug Description

Red Hat 6.6
Apache 2.2.15
MySQL 5.5.39
PHP 5.4.40

We found three issues while upgrading from Mahara 1.9.8 to 15.04.3. We have attached the tar file which contains the patch and various error logs for further help.

Upgrade Issue 1 - Add path and update records :

This adds a field 'path' to artefact table and thereafter runs a update query to add data. We have around 500K rows and this takes around 94 minutes to upgrade! This can be done in one go without the limit of 200 and it works very well taking around 2-3 minutes!

Few times the upgrade failed due to "mysqli error: [1205: Lock wait timeout exceeded; try restarting transaction]".

Upgrade Issue 2 - TinyMCE emoticon changes :

        $replacements = array('view' => 'description',
                              'artefact' => 'title',
                              'artefact' => 'description',
                              'group' => 'description',
                              'interaction_forum_post' => 'body',
                              'notification_internal_activity' => 'message',
                              'blocktype_wall_post' => 'text',
                              'site_content' => 'content');

The artefact key is defined twice in the array so as soon it reaches 'artefact' => 'description', it replaces the previous one which ends up skipping the title column to be updated.

Upgrade Issue 3 - TinyMCE emoticon changes - Typo! :

                    $configdata[$key] = preg_replace('/\/emotions\/img/', '/emotions/img', $value);

emotions are replaced emotions

Yaju Mahida (yvm)
description: updated
Revision history for this message
Yaju Mahida (yvm) wrote :
Revision history for this message
Yaju Mahida (yvm) wrote :

error logs

description: updated
Aaron Wells (u-aaronw)
Changed in mahara:
importance: Undecided → High
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/5372

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Hi Yaju,

Thanks for the patch! I've submitted it into our code review system.

I didn't include the part that changes the query batch size for the path rewrites, because we added that code in Bug 1479543 after there were earlier problems with large sites trying to run them all in one go.

Maybe it would make sense to just increase the batch size?

Cheers,
Aaron

Revision history for this message
Yaju Mahida (yvm) wrote :

Hi Aaron,

Yep understand that.

We increased the batch size but without any limit this works very well with our implementation (500k rows) so will leave it as it is for the moment.

But wonder that why with 200 limits it is struggling and sometime fails. Will investigate this further whenever time allows.

Cheers,
Yaju

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5372
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/f8c5a7f9e09a6f07d0220dc5552f22715f3381bf
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit f8c5a7f9e09a6f07d0220dc5552f22715f3381bf
Author: Yaju Mahida <email address hidden>
Date: Fri Sep 25 17:37:33 2015 +1200

Fix bugs in the emoticon-rewrite code (Bug 1499568)

1. Duplicate array index in the rewrite column list
2. Wrong directory name in the rewrite code

behatnotneeded: Covered by existing tests

Change-Id: I5d5085172d5fcd54ee634ae705d86b02ad320a3a

Revision history for this message
Robert Lyon (robertl-9) wrote :

I believe the limit of 200 was added for sites running MySql db as the transactions would build up and stress out the upgrade if the artefact table had many (250000+) rows.

This was compounded further if the site was using Elasticsearch as the adjusting of the artefact table automatically triggered an adding of a row to the elasticsearch queue table if it didn't already exist - and the more rows in there the longer it took as the check had to deal with more rows over time.

But since then we added a step to drop the Elasticsearch trigger before updating the artefact table and then adding back in the trigger after the update.

So the limit may not be needed anymore - it would mean testing an upgrade with a large database on mysql both with and without elasticsearch being in play.

Revision history for this message
Robert Lyon (robertl-9) wrote :

I'll spin off the Upgrade Issue 1 - Add path and update records :

as the patch for points 2 and 3 has been merged

See Bug #1500285

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "15.04_STABLE" branch: https://reviews.mahara.org/5377

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5377
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/c3907cd8c1f31f58a8030bb385b8593a3d8be952
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.04_STABLE

commit c3907cd8c1f31f58a8030bb385b8593a3d8be952
Author: Yaju Mahida <email address hidden>
Date: Fri Sep 25 17:37:33 2015 +1200

Fix bugs in the emoticon-rewrite code (Bug 1499568)

1. Duplicate array index in the rewrite column list
2. Wrong directory name in the rewrite code

behatnotneeded: Covered by existing tests

Change-Id: I5d5085172d5fcd54ee634ae705d86b02ad320a3a
(cherry picked from commit f8c5a7f9e09a6f07d0220dc5552f22715f3381bf)

Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.