Page MenuHomePhabricator

Add support for Redis database selection in MediaWiki RedisBagOStuff
Open, Needs TriagePublic

Description

The REDIS backend RedisConnectionPool.php and RedisBagOStuff.php do not support to select a DB index.

I'd like to add an additional connection option that allows just that. How do you like the option name dbindex?

e.g.:

$wgObjectCaches['redis'] = array(
    'class'                => 'RedisBagOStuff',
    'servers'              => array( '127.0.0.1:6379' ),
    // 'connectTimeout'    => 1,
    // 'persistent'        => false,
    // 'password'          => 'secret',
    // 'automaticFailOver' => true,
    // 'dbindex'           => 0,
);

I can code it myself and send a PR. What do you think?

Event Timeline

Tessus created this task.Jun 2 2017, 9:02 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 2 2017, 9:02 PM

Change 617123 had a related patch set uploaded (by Hyperzlib; owner: Hyperzlib):
[mediawiki/core@master] redis, objectcache: Allow using 'db' option to select redis database.

https://gerrit.wikimedia.org/r/617123

RazeSoldier edited projects, added MediaWiki-Cache; removed MediaWiki-General.
RazeSoldier moved this task from Untriaged to libs/objectcache on the MediaWiki-Cache board.
Krinkle renamed this task from RedisBagOStuff does not allow to select DB index to Add support for Redis database selection in MediaWiki RedisBagOStuff.EditedAug 12 2020, 2:26 AM
Krinkle added a project: Platform Engineering.
Krinkle added a subscriber: Krinkle.

I'm not entirely sure what this is for since MediaWiki generally does namespacing by prefix instead of separate DBs. What is the benefit or motivation for wanting this? Are there separate security/permission credentials?

Tagging PE to decide on this further.

eprodromou moved this task from Inbox to Feature Requests to Review on the Platform Engineering board.
eprodromou added subscribers: Hyperzlib, eprodromou.

I'll look this over.