From 2ca5d29744fcf0efa46f037e6e9a457b5af0039b Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 30 Oct 2008 01:12:56 +0000 Subject: [PATCH] * (bug 11533) Fixed insane slowdown when in read-only mode for long periods 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 | 2 ++ includes/BagOStuff.php | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 0de1511951..0582a7b1f6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/BagOStuff.php b/includes/BagOStuff.php index 9231132991..572dca6c41 100644 --- a/includes/BagOStuff.php +++ b/includes/BagOStuff.php @@ -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); -- 2.20.1