MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/364332 )

Change subject: Fix cleanupTitles.php
......................................................................

Fix cleanupTitles.php

It was failing in production with duplicate key error in
moveInconsistentPage(). Live-patching it to check for existence
for updates resolved the issues. Committing the fix now.

Change-Id: I1c0bf632b5040b44f5a49c8fb95779e7ed19dea9
---
M maintenance/cleanupTitles.php
1 file changed, 8 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/32/364332/1

diff --git a/maintenance/cleanupTitles.php b/maintenance/cleanupTitles.php
index ccc6406..50e17d8 100644
--- a/maintenance/cleanupTitles.php
+++ b/maintenance/cleanupTitles.php
@@ -25,6 +25,8 @@
  * @ingroup Maintenance
  */
 
+use MediaWiki\MediaWikiServices;
+
 require_once __DIR__ . '/cleanupTable.inc';
 
 /**
@@ -130,8 +132,11 @@
         * @param object $row
         * @param Title $title
         */
-       protected function moveInconsistentPage( $row, $title ) {
-               if ( $title->exists() || $title->getInterwiki() || 
!$title->canExist() ) {
+       protected function moveInconsistentPage( $row, Title $title ) {
+               if ( $title->exists( Title::GAID_FOR_UPDATE )
+                       || $title->getInterwiki()
+                       || !$title->canExist()
+               ) {
                        if ( $title->getInterwiki() || !$title->canExist() ) {
                                $prior = $title->getPrefixedDBkey();
                        } else {
@@ -179,7 +184,7 @@
                                ],
                                [ 'page_id' => $row->page_id ],
                                __METHOD__ );
-                       LinkCache::singleton()->clear();
+                       
MediaWikiServices::getInstance()->getLinkCache()->clear();
                }
        }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/364332
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c0bf632b5040b44f5a49c8fb95779e7ed19dea9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to