From: Marius Hoch Date: Wed, 29 Jul 2015 18:23:09 +0000 (+0200) Subject: Guard "NotPatrollablePage" negative caching against slave lag X-Git-Tag: 1.31.0-rc.0~9987^2 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=7fab3a7c212f4164eb41e24f4cfb8aa25c665409;p=lhc%2Fweb%2Fwiklou.git Guard "NotPatrollablePage" negative caching against slave lag After some poking I'm fairly sure this is why pages get "unpatrollable". Bug: T100986 Change-Id: I137b25ec0538dcc7ad8b6f1b32d5103fd256462c --- diff --git a/includes/page/Article.php b/includes/page/Article.php index 54db19ce0a..120aa5cc2b 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1121,16 +1121,26 @@ class Article implements Page { 'rc_new' => 1, 'rc_timestamp' => $oldestRevisionTimestamp, 'rc_namespace' => $this->getTitle()->getNamespace(), - 'rc_cur_id' => $this->getTitle()->getArticleID(), - 'rc_patrolled' => 0 + 'rc_cur_id' => $this->getTitle()->getArticleID() ), __METHOD__, array( 'USE INDEX' => 'new_name_timestamp' ) ); + } else { + // Cache the information we gathered above in case we can't patrol + // Don't cache in case we can patrol as this could change + $cache->set( wfMemcKey( 'NotPatrollablePage', $this->getTitle()->getArticleID() ), '1' ); } if ( !$rc ) { - // No RC entry around + // Don't cache: This can be hit if the page gets accessed very fast after + // its creation or in case we have high slave lag. In case the revision is + // too old, we will already return above. + return false; + } + + if ( $rc->getAttribute( 'rc_patrolled' ) ) { + // Patrolled RC entry around // Cache the information we gathered above in case we can't patrol // Don't cache in case we can patrol as this could change