From f7367dc97096a50091894879c74fc5ee615a9a55 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 28 Apr 2016 13:50:08 -0700 Subject: [PATCH] Avoid master queries on page views in loadFilterData() Bug: T92357 Change-Id: Ib7928067bc0b7ebd631d8abc96e3c24f81e78414 --- Views/AbuseFilterViewEdit.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Views/AbuseFilterViewEdit.php b/Views/AbuseFilterViewEdit.php index f847dd645..4b378a288 100644 --- a/Views/AbuseFilterViewEdit.php +++ b/Views/AbuseFilterViewEdit.php @@ -823,7 +823,9 @@ class AbuseFilterViewEdit extends AbuseFilterView { } // Load from master to avoid unintended reversions where there's replication lag. - $dbr = wfGetDB( DB_MASTER ); + $dbr = $this->getRequest()->wasPosted() + ? wfGetDB( DB_MASTER ) + : wfGetDB( DB_SLAVE ); // 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.