jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/374672 )
Change subject: DB_SLAVE -> DB_REPLICA
......................................................................
DB_SLAVE -> DB_REPLICA
Change-Id: I371e092b3cd7f0af3770bf4e64b01a630e23ff92
---
M includes/AFComputedVariable.php
M includes/AbuseFilter.class.php
M includes/AbuseFilter.hooks.php
M includes/Views/AbuseFilterViewDiff.php
M includes/Views/AbuseFilterViewEdit.php
M includes/Views/AbuseFilterViewExamine.php
M includes/Views/AbuseFilterViewList.php
M includes/Views/AbuseFilterViewRevert.php
M includes/Views/AbuseFilterViewTestBatch.php
M includes/api/ApiAbuseFilterCheckMatch.php
M includes/special/SpecialAbuseLog.php
M maintenance/addMissingLoggingEntries.php
12 files changed, 36 insertions(+), 36 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/AFComputedVariable.php b/includes/AFComputedVariable.php
index 886e2fe..45d635b 100644
--- a/includes/AFComputedVariable.php
+++ b/includes/AFComputedVariable.php
@@ -119,7 +119,7 @@
return [];
}
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'externallinks',
[ 'el_to' ],
@@ -373,7 +373,7 @@
case 'revision-text-by-timestamp':
$timestamp = $parameters['timestamp'];
$title = Title::makeTitle(
$parameters['namespace'], $parameters['title'] );
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$rev = Revision::loadFromTimestamp( $dbr,
$title, $timestamp );
$result = AbuseFilter::revisionToString( $rev );
break;
@@ -403,7 +403,7 @@
$cache->makeKey( 'last-10-authors', 'revision',
$title->getLatestRevID() ),
$cache::TTL_MINUTE,
function ( $oldValue, &$ttl, array &$setOpts ) use (
$title ) {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr
);
// Get the last 100 edit authors with a trivial
query (avoid T116557)
$revAuthors = $dbr->selectFieldValues(
diff --git a/includes/AbuseFilter.class.php b/includes/AbuseFilter.class.php
index 57d9a5a..ff2822b 100644
--- a/includes/AbuseFilter.class.php
+++ b/includes/AbuseFilter.class.php
@@ -287,10 +287,10 @@
if ( !$wgAbuseFilterCentralDB ) {
return false;
}
- $dbr = wfGetDB( DB_SLAVE, [], $wgAbuseFilterCentralDB );
+ $dbr = wfGetDB( DB_REPLICA, [], $wgAbuseFilterCentralDB
);
$filter = $globalIndex;
} else {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
}
if ( $filter === 'new' ) {
return false;
@@ -459,7 +459,7 @@
// Fetch from the database.
$filter_matched = [];
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'abuse_filter',
'*',
@@ -487,7 +487,7 @@
global $wgAbuseFilterCentralDB;
$fdb = wfGetLB( $wgAbuseFilterCentralDB
)->getConnectionRef(
- DB_SLAVE, [],
$wgAbuseFilterCentralDB
+ DB_REPLICA, [],
$wgAbuseFilterCentralDB
);
return iterator_to_array( $fdb->select(
@@ -675,7 +675,7 @@
global $wgAbuseFilterCentralDB;
// Load local filter info
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
// Retrieve the consequences.
$consequences = [];
@@ -684,7 +684,7 @@
}
if ( count( $globalFilters ) ) {
- $fdb = wfGetDB( DB_SLAVE, [], $wgAbuseFilterCentralDB );
+ $fdb = wfGetDB( DB_REPLICA, [], $wgAbuseFilterCentralDB
);
$consequences = $consequences +
self::loadConsequencesFromDB( $fdb, $globalFilters, 'global-' );
}
@@ -981,7 +981,7 @@
$log_template = [
'afl_user' => $user->getId(),
'afl_user_text' => $user->getName(),
- 'afl_timestamp' => wfGetDB( DB_SLAVE
)->timestamp( wfTimestampNow() ),
+ 'afl_timestamp' => wfGetDB( DB_REPLICA
)->timestamp( wfTimestampNow() ),
'afl_namespace' => $title->getNamespace(),
'afl_title' => $title->getDBkey(),
'afl_ip' => $wgRequest->getIP()
@@ -1027,10 +1027,10 @@
$id = $globalIndex;
$lb = wfGetLB( $wgAbuseFilterCentralDB );
- $dbr = $lb->getConnectionRef( DB_SLAVE, [],
$wgAbuseFilterCentralDB );
+ $dbr = $lb->getConnectionRef( DB_REPLICA, [],
$wgAbuseFilterCentralDB );
} else {
// Local wiki filter
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
}
$row = $dbr->selectRow( 'abuse_filter', '*', [ 'af_id'
=> $id ], __METHOD__ );
@@ -1314,7 +1314,7 @@
$text_id = substr( $stored_dump, strlen( 'stored-text:' ) );
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$text_row = $dbr->selectRow(
'text',
@@ -2418,7 +2418,7 @@
return $cache[$filterID];
}
- $fdb = wfGetDB( DB_SLAVE, [], $wgAbuseFilterCentralDB );
+ $fdb = wfGetDB( DB_REPLICA, [], $wgAbuseFilterCentralDB );
$cache[$filterID] = $fdb->selectField(
'abuse_filter',
@@ -2518,7 +2518,7 @@
static $firstChanges = [];
if ( !isset( $firstChanges[$filterID] ) ) {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow(
'abuse_filter_history',
'afh_id',
diff --git a/includes/AbuseFilter.hooks.php b/includes/AbuseFilter.hooks.php
index 855983d..93fe208 100644
--- a/includes/AbuseFilter.hooks.php
+++ b/includes/AbuseFilter.hooks.php
@@ -514,7 +514,7 @@
}
if ( $wgAbuseFilterCentralDB &&
!$wgAbuseFilterIsCentral ) {
- $dbr = wfGetDB( DB_SLAVE, [],
$wgAbuseFilterCentralDB );
+ $dbr = wfGetDB( DB_REPLICA, [],
$wgAbuseFilterCentralDB );
$where['af_global'] = 1;
$res = $dbr->select(
[ 'abuse_filter_action',
'abuse_filter' ],
diff --git a/includes/Views/AbuseFilterViewDiff.php
b/includes/Views/AbuseFilterViewDiff.php
index 2525c53..6c29664 100644
--- a/includes/Views/AbuseFilterViewDiff.php
+++ b/includes/Views/AbuseFilterViewDiff.php
@@ -128,7 +128,7 @@
* @return int|null Id of the next change or null if there isn't one
*/
function getNextHistoryId( $historyId ) {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow(
'abuse_filter_history',
'afh_id',
@@ -153,7 +153,7 @@
return $cache[$spec];
}
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$row = null;
if ( is_numeric( $spec ) ) {
$row = $dbr->selectRow(
diff --git a/includes/Views/AbuseFilterViewEdit.php
b/includes/Views/AbuseFilterViewEdit.php
index d4f6cc1..9f943c1 100644
--- a/includes/Views/AbuseFilterViewEdit.php
+++ b/includes/Views/AbuseFilterViewEdit.php
@@ -88,7 +88,7 @@
$filter = $this->mFilter;
$history_id = $this->mHistoryID;
if ( $this->mHistoryID ) {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow(
'abuse_filter_history',
'afh_id',
@@ -878,7 +878,7 @@
$existingSelector->setAttribute( 'disabled', 'disabled'
);
} else {
// Find other messages.
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$res = $dbr->select(
'page',
[ 'page_title' ],
@@ -926,7 +926,7 @@
// Load from master to avoid unintended reversions where
there's replication lag.
$dbr = $this->getRequest()->wasPosted()
? wfGetDB( DB_MASTER )
- : wfGetDB( DB_SLAVE );
+ : wfGetDB( DB_REPLICA );
// Load certain fields only. This prevents a condition seen on
Wikimedia where
// a schema change adding a new field caused that extra field
to be selected.
@@ -1098,7 +1098,7 @@
* Second element contains an array of abuse_filter_action rows.
*/
function loadHistoryItem( $id ) {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
// Load the row.
$row = $dbr->selectRow( 'abuse_filter_history',
diff --git a/includes/Views/AbuseFilterViewExamine.php
b/includes/Views/AbuseFilterViewExamine.php
index d86923e..ef7b439 100644
--- a/includes/Views/AbuseFilterViewExamine.php
+++ b/includes/Views/AbuseFilterViewExamine.php
@@ -76,7 +76,7 @@
function showExaminerForRC( $rcid ) {
// Get data
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow( 'recentchanges', '*', [ 'rc_id' =>
$rcid ], __METHOD__ );
$out = $this->getOutput();
if ( !$row ) {
@@ -94,7 +94,7 @@
function showExaminerForLogEntry( $logid ) {
// Get data
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow( 'abuse_filter_log', '*', [ 'afl_id' =>
$logid ], __METHOD__ );
$out = $this->getOutput();
@@ -226,7 +226,7 @@
* @fixme this is similar to AbuseFilterViewTestBatch::doTest
*/
function getQueryInfo() {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$conds = [];
$conds['rc_user_text'] = $this->mPage->mSearchUser;
diff --git a/includes/Views/AbuseFilterViewList.php
b/includes/Views/AbuseFilterViewList.php
index f48a53d..daecf8d 100644
--- a/includes/Views/AbuseFilterViewList.php
+++ b/includes/Views/AbuseFilterViewList.php
@@ -383,7 +383,7 @@
function __construct( $page, $conds, $linkRenderer ) {
parent::__construct( $page, $conds, $linkRenderer );
global $wgAbuseFilterCentralDB;
- $this->mDb = wfGetDB( DB_SLAVE, [], $wgAbuseFilterCentralDB );
+ $this->mDb = wfGetDB( DB_REPLICA, [], $wgAbuseFilterCentralDB );
}
function formatValue( $name, $value ) {
diff --git a/includes/Views/AbuseFilterViewRevert.php
b/includes/Views/AbuseFilterViewRevert.php
index 98e853e..1e8c77b 100644
--- a/includes/Views/AbuseFilterViewRevert.php
+++ b/includes/Views/AbuseFilterViewRevert.php
@@ -111,7 +111,7 @@
$conds = [ 'afl_filter' => $filter ];
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
if ( $periodStart ) {
$conds[] = 'afl_timestamp>' . $dbr->addQuotes(
$dbr->timestamp( $periodStart ) );
diff --git a/includes/Views/AbuseFilterViewTestBatch.php
b/includes/Views/AbuseFilterViewTestBatch.php
index 6c6d33b..790194d 100644
--- a/includes/Views/AbuseFilterViewTestBatch.php
+++ b/includes/Views/AbuseFilterViewTestBatch.php
@@ -89,7 +89,7 @@
$out->addWikiMsg( 'abusefilter-test-syntaxerr' );
return;
}
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$conds = [];
$conds['rc_user_text'] = $this->mTestUser;
@@ -167,7 +167,7 @@
&& count( $this->mParams ) > 1
&& is_numeric( $this->mParams[1] )
) {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$this->mFilter = $dbr->selectField( 'abuse_filter',
'af_pattern',
[ 'af_id' => $this->mParams[1] ],
diff --git a/includes/api/ApiAbuseFilterCheckMatch.php
b/includes/api/ApiAbuseFilterCheckMatch.php
index d2d4410..aa5e969 100644
--- a/includes/api/ApiAbuseFilterCheckMatch.php
+++ b/includes/api/ApiAbuseFilterCheckMatch.php
@@ -18,7 +18,7 @@
$vars->setVar( $name, $value );
}
} elseif ( $params['rcid'] ) {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow(
'recentchanges',
'*',
@@ -32,7 +32,7 @@
$vars = AbuseFilter::getVarsFromRCRow( $row );
} elseif ( $params['logid'] ) {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow(
'abuse_filter_log',
'*',
diff --git a/includes/special/SpecialAbuseLog.php
b/includes/special/SpecialAbuseLog.php
index 5d73c59..a727948 100644
--- a/includes/special/SpecialAbuseLog.php
+++ b/includes/special/SpecialAbuseLog.php
@@ -163,7 +163,7 @@
return;
}
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow(
[ 'abuse_filter_log', 'abuse_filter' ],
@@ -291,7 +291,7 @@
if ( $this->mSearchEntries == '1' ) {
$conds['afl_deleted'] = 1;
} elseif ( $this->mSearchEntries == '2' ) {
- $conds[] = self::getNotDeletedCond( wfGetDB(
DB_SLAVE ) );
+ $conds[] = self::getNotDeletedCond( wfGetDB(
DB_REPLICA ) );
}
}
@@ -314,7 +314,7 @@
function showDetails( $id ) {
$out = $this->getOutput();
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
$row = $dbr->selectRow(
[ 'abuse_filter_log', 'abuse_filter' ],
diff --git a/maintenance/addMissingLoggingEntries.php
b/maintenance/addMissingLoggingEntries.php
index 1711d59..39c4a17 100644
--- a/maintenance/addMissingLoggingEntries.php
+++ b/maintenance/addMissingLoggingEntries.php
@@ -21,7 +21,7 @@
$afhRows = [];
// Find all entries in abuse_filter_history without logging
entry of same timestamp
- $afhResult = wfGetDB( DB_SLAVE, 'vslow' )->select(
+ $afhResult = wfGetDB( DB_REPLICA, 'vslow' )->select(
[ 'abuse_filter_history', 'logging' ],
[ 'afh_id', 'afh_filter', 'afh_timestamp', 'afh_user',
'afh_deleted', 'afh_user_text' ],
[ 'log_id IS NULL' ],
@@ -46,7 +46,7 @@
$this->error( "Nothing to do.", 1 );
}
- $logResult = wfGetDB( DB_SLAVE )->select(
+ $logResult = wfGetDB( DB_REPLICA )->select(
'logging',
[ 'log_params' ],
[ 'log_type' => 'abusefilter', 'log_params' =>
$logParams ],
--
To view, visit https://gerrit.wikimedia.org/r/374672
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I371e092b3cd7f0af3770bf4e64b01a630e23ff92
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: Dbarratt <[email protected]>
Gerrit-Reviewer: Dmaza <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits