avoid link cache issues with duplicate title keys for xml dumps
authorAriel T. Glenn <ariel@wikimedia.org>
Mon, 8 Apr 2019 06:45:55 +0000 (09:45 +0300)
committerAriel T. Glenn <ariel@wikimedia.org>
Mon, 8 Apr 2019 18:46:54 +0000 (21:46 +0300)
Bug: T220316
Change-Id: If73d6c9b4cac298a7832d65ffa34bc8f69b87752

includes/export/XmlDumpWriter.php

index 6ca8853..2ae5c2f 100644 (file)
@@ -207,6 +207,12 @@ class XmlDumpWriter {
         * @return string
         */
        function closePage() {
+               if ( $this->currentTitle !== null ) {
+                       $linkCache = MediaWikiServices::getInstance()->getLinkCache();
+                       // In rare cases, link cache has the same key for some pages which
+                       // might be read as part of the same batch. T220424 and T220316
+                       $linkCache->clearLink( $this->currentTitle );
+               }
                return "  </page>\n";
        }