https://bugzilla.wikimedia.org/show_bug.cgi?id=59987

       Web browser: ---
            Bug ID: 59987
           Summary: SpecialContributions Revision::getParentLengths wrong
                    load balancing db connection
           Product: MediaWiki
           Version: 1.23-git
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Special pages
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: sprin...@wikimedia.org
    Classification: Unclassified
   Mobile Platform: ---

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to