jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/347601 )

Change subject: Fix dumpIndex.php
......................................................................


Fix dumpIndex.php

The logic was wrong and the dump was stopped too early.
I'm not even sure to understand how this code could have dumped
around 500k lines for some indices.

Bug: T162665
Change-Id: Iaff2270df785c856c45d6c1326a818bff236cac7
---
M maintenance/dumpIndex.php
1 file changed, 4 insertions(+), 3 deletions(-)

Approvals:
  EBernhardson: Looks good to me, approved
  jenkins-bot: Verified

Objections:
  Cindy-the-browser-test-bot: There's a problem with this change, please improve



diff --git a/maintenance/dumpIndex.php b/maintenance/dumpIndex.php
index 00f791c..d54424d 100644
--- a/maintenance/dumpIndex.php
+++ b/maintenance/dumpIndex.php
@@ -123,6 +123,7 @@
 
                $query = new Query();
                $query->setStoredFields( [ '_id', '_type', '_source' ] );
+               $query->setSize( $this->inputChunkSize );
                $query->setSort( [ '_doc' ] );
                if ( $this->hasOption( 'sourceFields' ) ) {
                        $sourceFields = explode( ',', $this->getOption( 
'sourceFields' ) );
@@ -160,13 +161,13 @@
                                ];
                                $this->write( $document );
                                $docsDumped++;
-                               if ( $docsDumped > $limit ) {
+                               if ( $docsDumped >= $totalDocsToDump ) {
                                        break;
                                }
-                               $this->outputProgress( $docsDumped, 
$totalDocsToDump );
                        }
+                       $this->outputProgress( $docsDumped, $totalDocsToDump );
                }
-               $this->output( "Dump done.\n" );
+               $this->output( "Dump done ($docsDumped docs).\n" );
        }
 
        /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaff2270df785c856c45d6c1326a818bff236cac7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: DCausse <[email protected]>
Gerrit-Reviewer: Cindy-the-browser-test-bot <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Gehel <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: Tjones <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to