Page MenuHomePhabricator

Use DB_REPLICA constant instead of DB_SLAVE
Closed, ResolvedPublic

Description

From https://gerrit.wikimedia.org/g/mediawiki/core/+/master/includes/Defines.php

/**
 * @deprecated since 1.28
 */
define( 'DB_SLAVE', -1 );

From https://gerrit.wikimedia.org/g/mediawiki/core/+/master/includes/libs/rdbms/loadbalancer/ILoadBalancer.php

/** @var int Request a replica DB connection */
	const DB_REPLICA = -1;

From https://gerrit.wikimedia.org/g/mediawiki/core/+/master/HISTORY

=== Other changes in 1.30 ===
* DB_SLAVE is deprecated. DB_REPLICA should be used instead.

=== Changes since 1.27.3 ===
* DB_REPLICA constant added from REL1_28+ to ease backports to extensions and core.

This will good If We Replace the DB_SLAVE to DB_REPLICA.
DB_REPLICA was added from 1.28, So We will first forward those extensions which have 1.29 dependency.

=> Code search: https://codesearch.wmflabs.org/search/?q=DB_SLAVE

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jayprakash12345 renamed this task from Use DB_REPLICA constant DB_SLAVE to Use DB_REPLICA constant instead of DB_SLAVE.Mar 22 2018, 8:24 AM

Change 421240 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/CongressLookup@master] Use DB_REPLICA constant instead of DB_SLAVE

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

Change 421251 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/LastUserLogin@master] Use DB_REPLICA constant instead of DB_SLAVE

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

Change 421253 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/MultiLanguageManager@master] Use DB_REPLICA constant instead of DB_SLAVE

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

Change 421254 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/PageLanguage@master] Use DB_REPLICA constant instead of DB_SLAVE

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

Change 421258 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/TimeMachine@master] Use DB_REPLICA constant instead of DB_SLAVE

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

Change 421259 had a related patch set (by Jayprakash12345) published:
[mediawiki/extensions/UserPageViewTracker@master] Use DB_REPLICA constant instead of DB_SLAVE

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

Change 421259 merged by jenkins-bot:
[mediawiki/extensions/UserPageViewTracker@master] Use DB_REPLICA constant instead of DB_SLAVE

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

Change 421258 merged by jenkins-bot:
[mediawiki/extensions/TimeMachine@master] Use DB_REPLICA constant instead of DB_SLAVE

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

Change 421254 merged by jenkins-bot:
[mediawiki/extensions/PageLanguage@master] Use DB_REPLICA constant instead of DB_SLAVE

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

Change 421253 merged by jenkins-bot:
[mediawiki/extensions/MultiLanguageManager@master] Use DB_REPLICA constant instead of DB_SLAVE

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

Change 421251 merged by jenkins-bot:
[mediawiki/extensions/LastUserLogin@master] Use DB_REPLICA constant instead of DB_SLAVE

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

Change 421240 merged by jenkins-bot:
[mediawiki/extensions/CongressLookup@master] Use DB_REPLICA constant instead of DB_SLAVE

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

The constant has been removed from core meaning anything not using it is already broken. The search result is only third parties that are not deployed in production. Should we call this done?

The constant has been removed from core meaning anything not using it is already broken. The search result is only third parties that are not deployed in production. Should we call this done?

Should we remove it from codesniffer then?

The constant has been removed from core meaning anything not using it is already broken. The search result is only third parties that are not deployed in production. Should we call this done?

Should we remove it from codesniffer then?

I don't think so. If it exists in an extension it's clearly wrong and should be flagged :)