Page MenuHomePhabricator

Explicitly providing a database index to LoadBalancer::getConnection() should return the selected connection.
Closed, ResolvedPublic

Description

Currently, passing anything but DB_MASTER to LoadBalancer::getConnection() will result in a replica being selected based on load balancing and the specified groups. Effectively, it'S impossible to select a specific connection by providing an explicit index.

This issue was introduced by https://gerrit.wikimedia.org/r/#/c/178747/ and, even before that, in https://phabricator.wikimedia.org/rSVN8540 (MW 1.4). In the light of this, perhaps the interface contract should be changed to do disallow explicit selection - the fact that this issue went undetected for years indicates that there is no need for explicit selection of connections.

Event Timeline

daniel created this task.Jan 9 2018, 2:34 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 9 2018, 2:34 PM

Change 401594 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] getConnection( getWriterIndex() ) should return master connection.

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

Change 401594 abandoned by Daniel Kinzler:
getConnection( getWriterIndex() ) should return master connection.

Reason:
Squashed into I835a2523

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

Change 401520 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] getConnection( getWriterIndex() ) should return master connection.

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

238482n375 set Security to Software security bug.Jun 15 2018, 8:06 AM
238482n375 added a project: acl*security.
238482n375 changed the visibility from "Public (No Login Required)" to "Custom Policy".
238482n375 added a subscriber: 238482n375.
This comment was removed by Vgutierrez.
Vgutierrez changed the visibility from "Custom Policy" to "Public (No Login Required)".
Vgutierrez added a subscriber: Vgutierrez.
Vgutierrez removed a subscriber: Vgutierrez.
Restricted Application added a project: acl*security. · View Herald TranscriptJun 15 2018, 10:16 AM
Vgutierrez removed a subscriber: 238482n375.
aaron closed this task as Resolved.Jun 15 2018, 6:43 PM
aaron claimed this task.

Change 401520 abandoned by Krinkle:
getConnection( getWriterIndex() ) should return master connection.

Reason:
Superseded by 0514345f0

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