Jcrespo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350006 )

Change subject: Add FORCE INDEX to AFComputedVariable::{closure}
......................................................................

Add FORCE INDEX to AFComputedVariable::{closure}

We add FORCE INDEX to revision because probably we have hit a MariaDB
bug that can potentially create an outage on pages with thousands of
revisions due to extreme resource usage by this query when using the
wrong index page_user_timestamp, instead of page_timestamp.

This is considered to be a hack, and once we are in the clear, I promise
to review this an try to get a saner execution path (both in MySQL and
in PHP.

Bug: T116557
Change-Id: I41853da5c0e1a15efad5594eff0cee62be1ad9a4
---
M includes/AFComputedVariable.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter 
refs/changes/06/350006/3

diff --git a/includes/AFComputedVariable.php b/includes/AFComputedVariable.php
index 9c88cde..9f1631f 100644
--- a/includes/AFComputedVariable.php
+++ b/includes/AFComputedVariable.php
@@ -414,7 +414,11 @@
                                        array( 'rev_page' => 
$title->getArticleID() ),
                                        __METHOD__,
                                        // Some pages have < 10 authors but 
many revisions (e.g. bot pages)
-                                       array( 'ORDER BY' => 'rev_timestamp 
DESC', 'LIMIT' => 100 )
+                                       // Also see Bug: T116557
+                                       array( 'ORDER BY' => 'rev_timestamp 
DESC',
+                                               'LIMIT' => 100,
+                                               'USE INDEX' => 'page_timestamp',
+                                       )
                                );
                                // Get the last 10 distinct authors within this 
set of edits
                                $users = array();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41853da5c0e1a15efad5594eff0cee62be1ad9a4
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: Jcrespo <[email protected]>
Gerrit-Reviewer: Jcrespo <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to