Last modified: 2011-11-25 07:27:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T24923, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 22923 - MediaWiki should revert to read-only if MySQL error indicates DB in read-only
MediaWiki should revert to read-only if MySQL error indicates DB in read-only
Status: NEW
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.14.x
All All
: Low enhancement with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-22 18:19 UTC by justin
Modified: 2011-11-25 07:27 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Screenshot of Mediawiki 1.16.0 Beta 1 with MySQL 5.0.67 in read_only mode. (68.34 KB, image/png)
2010-03-25 09:28 UTC, mark.ziegler
Details

Description justin 2010-03-22 18:19:03 UTC
I have a MySQL ecosystem of a Master and a number of slaves, with an ip address that can be brought up on the master or any of the slaves for High Availability.

To reduce problems with re-syncing the master from a slave if a failover is needed (failover=the ip address is brought up on a slave after the master crashes), all the MySQL slaves are marked as read-only in their configuration and only after determining that the master MySQL server will be down for an extended period of time, will a slave be brought up read-write and made the new master until the primary master is fixed.

MediaWiki does not operate on a read-only slave, and this is an enhancement request to allow MediaWiki to operate in a read-only MySQL environment. Currently errors are thrown (usually couldn't update the objectcache), although some pages do occasionally load).

The error thrown is 1290, and if this could be caught and recognised as a MySQL read-only server error, MediaWiki could simply throw away any write queries and make only read queries against the server. Of course, each new page load would represent a new attempt at writing, since at any time the MySQL server could be brought up read-write or failed back to the master server.

The error displayed is as follows for one attempt at a page load:

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:

    DELETE FROM `objectcache` WHERE keyname='wiki_staging:pcache:idhash:19674-0!1!0!!en!2'

from within function "MediaWikiBagOStuff::_doquery". MySQL returned error "1290: The MySQL server is running with the --read-only option so it cannot execute this statement (mysql-server-name)".
Comment 1 Sam Reed (reedy) 2010-03-23 08:21:54 UTC
If you are using version 1.14, you should really be upgrading, 1.15.2 is considered stable, and 1.16 is not far away

And then need to see if it still occurs in a newer version
Comment 2 justin 2010-03-23 17:54:13 UTC
(In reply to comment #1)
> If you are using version 1.14, you should really be upgrading, 1.15.2 is
> considered stable, and 1.16 is not far away
> 
> And then need to see if it still occurs in a newer version

Downtimes on our wiki are difficult to schedule, and we customize new releases before upgrading. We've been waiting for 1.16 to be released so we can upgrade to that version. When it is released, I'll report back if this is still a valid enhancement request or not, and close if appropriate.
Comment 3 Chad H. 2010-03-23 18:09:32 UTC
I *believe* this issue was fixed in r55079, so an upgrade *should* fix it. Hopefully :)
Comment 4 mark.ziegler 2010-03-25 07:09:53 UTC
Just tried with 1.116.0beta1.
No success.
Still receiving message "1290: The MySQL server is running with the --read-only option so it cannot execute this statement (localhost)" and so I am unable to view self created page. Page "recent changes" works.
Comment 5 mark.ziegler 2010-03-25 09:28:36 UTC
Created attachment 7239 [details]
Screenshot of Mediawiki 1.16.0 Beta 1 with MySQL 5.0.67 in read_only mode.
Comment 6 mark.ziegler 2010-03-25 10:04:05 UTC
Another test with MediaWiki 1.17alpha (r64152).
Result is the same as mentioned above.
Comment 7 justin 2010-04-22 17:30:13 UTC
I now have a 1.16 Beta2 Version of the wiki running, and have found that viewing pages from a read-only MySQL server works (page is displayed at top, and error message is displayed on the bottom)

I have 2 suggestions:
1) When viewing a page from a MySQL server marked as read-only, the wiki page is shown, and then below that all the toolbars are shown as if it were a wiki page, and the read-only MySQL error is shown. I suggest showing a simple sentence at the bottom or top of the page indicating the wiki is read-only, instead of showing a large page below the existing page (most aren't going to care about the error, unless they go to edit a page)

2) If MySQL returns a read-only error, make a more friendly error message such as "Database Error: MySQL is running read-only." or similarly simple message (users don't read error messages, as you may know).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links