jenkins-bot has submitted this change and it was merged.

Change subject: Use DB_REPLICA instead of DB_SLAVE
......................................................................


Use DB_REPLICA instead of DB_SLAVE

Change-Id: If31088669598c2d087a91a557bdb0a99a06336d2
---
M includes/BuildDocument/RedirectsAndIncomingLinks.php
M includes/Sanity/Checker.php
M maintenance/forceSearchIndex.php
M maintenance/saneitize.php
M maintenance/saneitizeJobs.php
5 files changed, 9 insertions(+), 9 deletions(-)

Approvals:
  Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
  EBernhardson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/BuildDocument/RedirectsAndIncomingLinks.php 
b/includes/BuildDocument/RedirectsAndIncomingLinks.php
index 8febcf3..aaa35a4 100644
--- a/includes/BuildDocument/RedirectsAndIncomingLinks.php
+++ b/includes/BuildDocument/RedirectsAndIncomingLinks.php
@@ -80,7 +80,7 @@
         * @return int|null The number of incoming links, or null on failure
         */
        private static function countIncomingLinks( array $titles ) {
-               $dbr = wfGetDB( DB_SLAVE, 'vslow' );
+               $dbr = wfGetDB( DB_REPLICA, 'vslow' );
 
                $conditions = [];
                foreach ( $titles as $title ) {
diff --git a/includes/Sanity/Checker.php b/includes/Sanity/Checker.php
index 32fc48a..ae44be2 100644
--- a/includes/Sanity/Checker.php
+++ b/includes/Sanity/Checker.php
@@ -291,7 +291,7 @@
                if ( empty( $pageIds ) ) {
                        return $cache->getArrayCopy();
                }
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_REPLICA );
                $where = 'page_id IN (' . $dbr->makeList( $pageIds ) . ')';
                $res = $dbr->select(
                        [ 'page' ],
diff --git a/maintenance/forceSearchIndex.php b/maintenance/forceSearchIndex.php
index 48b4299..17e88eb 100644
--- a/maintenance/forceSearchIndex.php
+++ b/maintenance/forceSearchIndex.php
@@ -337,7 +337,7 @@
        }
 
        protected function getDeletesIterator() {
-               $dbr = $this->getDB( DB_SLAVE );
+               $dbr = $this->getDB( DB_REPLICA );
                $it = new BatchRowIterator(
                        $dbr,
                        'archive',
@@ -370,7 +370,7 @@
 
 
        protected function getIdsIterator() {
-               $dbr = $this->getDB( DB_SLAVE );
+               $dbr = $this->getDB( DB_REPLICA );
                $it = new BatchRowIterator( $dbr, 'page', 'page_id', 
$this->mBatchSize );
                $it->addConditions( [
                        'page_id in (' . $dbr->makeList( $this->pageIds, 
LIST_COMMA ) . ')',
@@ -381,7 +381,7 @@
        }
 
        protected function getUpdatesByDateIterator() {
-               $dbr = $this->getDB( DB_SLAVE );
+               $dbr = $this->getDB( DB_REPLICA );
                $it = new BatchRowIterator(
                        $dbr,
                        [ 'page', 'revision' ],
@@ -400,7 +400,7 @@
        }
 
        protected function getUpdatesByIdIterator() {
-               $dbr = $this->getDB( DB_SLAVE );
+               $dbr = $this->getDB( DB_REPLICA );
                $it = new BatchRowIterator( $dbr, 'page', 'page_id', 
$this->mBatchSize );
                $fromId = $this->getOption( 'fromId', 0 );
                if ( $fromId > 0 ) {
@@ -541,7 +541,7 @@
         *  will be spat out sized to cover the entire wiki.
         */
        private function buildChunks( $buildChunks ) {
-               $dbr = $this->getDB( DB_SLAVE );
+               $dbr = $this->getDB( DB_REPLICA );
                if ( $this->toId === null ) {
                        $this->toId = $dbr->selectField( 'page', 'MAX(page_id)' 
);
                        if ( $this->toId === false ) {
diff --git a/maintenance/saneitize.php b/maintenance/saneitize.php
index 62b9e52..e6625c4 100644
--- a/maintenance/saneitize.php
+++ b/maintenance/saneitize.php
@@ -122,7 +122,7 @@
        }
 
        private function setFromAndTo() {
-               $dbr = $this->getDB( DB_SLAVE );
+               $dbr = $this->getDB( DB_REPLICA );
                $this->fromPageId = $this->getOption( 'fromId' );
                if ( $this->fromPageId === null ) {
                        $this->fromPageId = 0;
diff --git a/maintenance/saneitizeJobs.php b/maintenance/saneitizeJobs.php
index af6b2dd..7f215c4 100644
--- a/maintenance/saneitizeJobs.php
+++ b/maintenance/saneitizeJobs.php
@@ -99,7 +99,7 @@
        }
 
        private function init() {
-               $res = $this->getDB( DB_SLAVE )->select( 'page',
+               $res = $this->getDB( DB_REPLICA )->select( 'page',
                        [ 'MIN(page_id) as min_id', 'MAX(page_id) as max_id' ] 
);
                $row = $res->next();
                /** @suppress PhanUndeclaredProperty */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If31088669598c2d087a91a557bdb0a99a06336d2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: DCausse <dcau...@wikimedia.org>
Gerrit-Reviewer: Cindy-the-browser-test-bot <bernhardsone...@gmail.com>
Gerrit-Reviewer: EBernhardson <ebernhard...@wikimedia.org>
Gerrit-Reviewer: Gehel <gleder...@wikimedia.org>
Gerrit-Reviewer: Manybubbles <never...@wikimedia.org>
Gerrit-Reviewer: Smalyshev <smalys...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to