Last modified: 2014-02-15 13:27:29 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 T61987, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 59987 - SpecialContributions Revision::getParentLengths wrong load balancing db connection
SpecialContributions Revision::getParentLengths wrong load balancing db conne...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.23.0
All All
: Normal normal (vote)
: ---
Assigned To: Sean Pringle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-13 06:32 UTC by Sean Pringle
Modified: 2014-02-15 13:27 UTC (History)
2 users (show)

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


Attachments

Description Sean Pringle 2014-01-13 06:32:30 UTC
SpecialContributions::doBatchLookups() calls Revision::getParentLengths() like this:

Revision::getParentLengths( $this->getDatabase(), $revIds );

getDatabase returns $this->mDb which is set in the SpecialContributions constructor using 'contributions' to identify it to the database load balancer:

$this->mDb = wfGetDB( DB_SLAVE, 'contributions' );

Passing mDb to getParentLengths is not ideal as the query type is quite different and limits what can be done in the backend. Consider passing a normal unnamed slave connection instead.

On WMF production shards mDb is usually a connection to a slave set aside for special queries on a shard. One of the possible optimizations that can be applied to such slaves is table partitioning based on range or hash of rev_user  (this approach is proving effective for the similar LogPager queries).

Unfortunately partitioning increases the cost of some other types of queries including the huge batched lookups generated by getParentLengths. It would be nice to have the best of both worlds.
Comment 1 Gerrit Notification Bot 2014-01-14 03:46:11 UTC
Change 107319 had a related patch set uploaded by Legoktm:
SpecialContributions: Avoid using 'contributions' slave for getParentLengths

https://gerrit.wikimedia.org/r/107319
Comment 2 Gerrit Notification Bot 2014-01-14 20:14:35 UTC
Change 107319 merged by jenkins-bot:
SpecialContributions: Avoid using 'contributions' slave for getParentLengths

https://gerrit.wikimedia.org/r/107319
Comment 3 Gerrit Notification Bot 2014-01-15 04:15:07 UTC
Change 107545 had a related patch set uploaded by Aaron Schulz:
Use regular slaves for user contribs parent revision queries

https://gerrit.wikimedia.org/r/107545
Comment 4 Gerrit Notification Bot 2014-01-16 07:41:34 UTC
Change 107545 had a related patch set uploaded by Krinkle:
Use regular slaves for user contribs parent revision queries

https://gerrit.wikimedia.org/r/107545
Comment 5 Gerrit Notification Bot 2014-01-30 19:02:30 UTC
Change 107545 merged by jenkins-bot:
Use regular slaves for user contribs parent revision queries

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

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


Navigation
Links