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

Change subject: Removed newFromConds master fallback logic; obsoleted by $flags
......................................................................


Removed newFromConds master fallback logic; obsoleted by $flags

Bug: T86862
Change-Id: I6867a61fff9828fb32b063c1e84872e910c4b273
---
M includes/Revision.php
1 file changed, 0 insertions(+), 10 deletions(-)

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



diff --git a/includes/Revision.php b/includes/Revision.php
index d535028..6f57bc0 100644
--- a/includes/Revision.php
+++ b/includes/Revision.php
@@ -121,8 +121,6 @@
                if ( $id ) {
                        // Use the specified ID
                        $conds['rev_id'] = $id;
-                       // This uses slave->master fallback with READ_NORMAL. 
Assuming revdelete,
-                       // moves, and merges are rare, callers can use this to 
reduce master queries.
                        return self::newFromConds( $conds, $flags );
                } else {
                        // Use a join to get the latest revision
@@ -150,8 +148,6 @@
                $conds = array( 'page_id' => $pageId );
                if ( $revId ) {
                        $conds['rev_id'] = $revId;
-                       // This uses slave->master fallback with READ_NORMAL. 
Assuming revdelete
-                       // and merges are rare, callers can use this to reduce 
master queries.
                        return self::newFromConds( $conds, $flags );
                } else {
                        // Use a join to get the latest revision
@@ -310,12 +306,6 @@
        private static function newFromConds( $conditions, $flags = 0 ) {
                $db = wfGetDB( ( $flags & self::READ_LATEST ) ? DB_MASTER : 
DB_SLAVE );
                $rev = self::loadFromConds( $db, $conditions, $flags );
-               if ( $rev === null && wfGetLB()->getServerCount() > 1 ) {
-                       if ( !( $flags & self::READ_LATEST ) ) {
-                               $dbw = wfGetDB( DB_MASTER );
-                               $rev = self::loadFromConds( $dbw, $conditions, 
$flags );
-                       }
-               }
                if ( $rev ) {
                        $rev->mQueryFlags = $flags;
                }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6867a61fff9828fb32b063c1e84872e910c4b273
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
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