Last modified: 2013-10-23 18:17:20 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 T34853, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 32853 - DBA caching backend is broken in MW 1.18 ($dir is an array)
DBA caching backend is broken in MW 1.18 ($dir is an array)
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.18.x
All All
: Normal major (vote)
: 1.18.x release
Assigned To: Antoine "hashar" Musso (WMF)
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-07 08:54 UTC by Szőts Ákos
Modified: 2013-10-23 18:17 UTC (History)
3 users (show)

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


Attachments

Description Szőts Ákos 2011-12-07 08:54:28 UTC
In MediaWiki 1.18, when you set DBA as the main caching mechanism ($wgMainCacheType = CACHE_DB) you'll run into an error.

In includes/objectcache/DBABagOStuff.php on line 17 you check if $dir === false or not. In my case it isn't, so you assign its value to $this->mFile = "$dir/mw-cache-" . wfWikiID();.

The problem is that from v1.18 on the $dir is an array.

I got the following when I print_r'd the $dir variable in the first line of the __construct function: Array ( [class] => DBABagOStuff ).

Of course in this case the $this->mFile = "$dir/mw-cache-" . wfWikiID(); line will be broken also and that's why later MW cannot open the DBA cache.

For an ugly workaround I forced the $wgTempDirectory to be assigned to the $dir variable:

if ( $dir === false || is_array($dir) ) {
	global $wgTmpDirectory;
	$dir = $wgTmpDirectory;
}
Comment 1 Antoine "hashar" Musso (WMF) 2011-12-07 11:08:00 UTC
We did some refactoring for the object cache refactoring. I did send a patch as r105419 which might apply to 1.18 as is.

Once patch is applied, you will be able to configure the CACHE_DBA backend using:

 $wgObjectCaches[CACHE_DBA]['dir'] = '/some/directory/'


Keeping bug open until revision is reviewed in trunk, will then back port it to 1.18 and mark this bug fixed.
Comment 2 Antoine "hashar" Musso (WMF) 2011-12-09 21:31:31 UTC
backported in REL1_18 with r105706 will be in 1.18.1

Please note another developer advise against the use of CACHE_DBA except for testing  :D
Comment 3 Szőts Ákos 2011-12-10 18:57:52 UTC
Thank you for the quick fix!

On a shared hosting I think this is the "best" solution before CACHE_NONE, so I'm forced to use this.

Fortunately, if everything goes well we'll move to an other server where APC will be turned on, so we can forget the DBA caching.

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


Navigation
Links