* (bug 11533) Fixed insane slowdown when in read-only mode for long periods
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 30 Oct 2008 01:12:56 +0000 (01:12 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 30 Oct 2008 01:12:56 +0000 (01:12 +0000)
  of time with CACHE_NONE (default objectcache table configuration).

MediaWikiBagOStuff was refusing to perform any cache updates when in read-only
mode. This made sense originally when read-only mode was an extreme hardcore
"nothing can write to the DB EVAR because we're doing weird things to it",
but today we do allow backend writes of various sorts, and it's mainly meant
to stop user-level activity.

The refusal to perform updates caused the MessageCache to spend a long period
of time retrying the storage of the cache if it had expired out of the table previously... which is kind of bad as every page load would be insanely slow. :D

RELEASE-NOTES
includes/BagOStuff.php

index 0de1511..0582a7b 100644 (file)
@@ -293,6 +293,8 @@ The following extensions are migrated into MediaWiki 1.14:
 * Allow '0' to be an accesskey.
 * (bug 8063) Use language-dependent sorting in client-side sortable tables
 * (bug 16160) Suggestions box should be resized from left for RTL wikis
+* (bug 11533) Fixed insane slowdown when in read-only mode for long periods
+  of time with CACHE_NONE (default objectcache table configuration).
 
 === API changes in 1.14 ===
 
index 9231132..572dca6 100644 (file)
@@ -475,8 +475,19 @@ class MediaWikiBagOStuff extends SqlBagOStuff {
        function _fromunixtime($ts) {
                return $this->_getDB()->timestamp($ts);
        }
+       /***
+        * Note -- this should *not* check wfReadOnly().
+        * Read-only mode has been repurposed from the original
+        * "nothing must write to the database" to "users should not
+        * be able to edit or alter anything user-visible".
+        *
+        * Backend bits like the object cache should continue
+        * to work in this mode, otherwise things will blow up
+        * like the message cache failing to save its state,
+        * causing long delays (bug 11533).
+        */
        function _readonly(){
-               return wfReadOnly();
+               return false;
        }
        function _strencode($s) {
                return $this->_getDB()->strencode($s);