Cache countable statistics to prevent multiple counting on import
authorThis, that and the other <at.light@live.com.au>
Wed, 4 Feb 2015 07:00:36 +0000 (18:00 +1100)
committerThis, that and the other <at.light@live.com.au>
Wed, 4 Feb 2015 07:00:36 +0000 (18:00 +1100)
commit341dfa2587220c8e9dff5866036b3092ceb682c4
treeeb7638df9b285caeb59d4a4d5980e7a838ec450e
parentb4550b162d162c9c90713df19fa258cb4e78e358
Cache countable statistics to prevent multiple counting on import

At the moment, when $wgArticleCountMethod = 'link' (as it is on the WMF
cluster), we are querying the Slave database before each individual
revision is imported, in order to find out whether the page is countable
at that time. This is not sensible, as (1) the slave lags behind the
master, but (2) even the master may not be up to date, since page link
updates take place through the job queue.

This change sets up a cache to hold countable values for pages where import
activity has already occurred. That way, we aren't hitting the DB on every
revision, only to get an incorrect response back.

Bug: T42009
Change-Id: I99189c82672d7790cda5036b6aa9883ce6e566b0
includes/Import.php
includes/page/WikiPage.php