Remove upgradeRow() call from ?action=purge
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 4 May 2016 17:56:23 +0000 (10:56 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 4 May 2016 17:56:23 +0000 (10:56 -0700)
This is overkill and can cause excess lock contention
on larger files. Purges are typically used to fix
thumbnails or CDN, not metadata. Scripts can always
be run to fix any real breakage.

Bug: T132921
Change-Id: Ieecf1c015735b7219ca51c87951b59c453cf588f

includes/page/WikiFilePage.php

index a6b9915..0dc28bd 100644 (file)
  * @ingroup Media
  */
 class WikiFilePage extends WikiPage {
-       /**
-        * @var File
-        */
+       /** @var File */
        protected $mFile = false;
+       /** @var LocalRepo */
        protected $mRepo = null;
+       /** @var bool */
        protected $mFileLoaded = false;
+       /** @var array */
        protected $mDupes = null;
 
        public function __construct( $title ) {
@@ -170,7 +171,6 @@ class WikiFilePage extends WikiPage {
                if ( $this->mFile->exists() ) {
                        wfDebug( 'ImagePage::doPurge purging ' . $this->mFile->getName() . "\n" );
                        DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this->mTitle, 'imagelinks' ) );
-                       $this->mFile->upgradeRow();
                        $this->mFile->purgeCache( [ 'forThumbRefresh' => true ] );
                } else {
                        wfDebug( 'ImagePage::doPurge no image for '