From fb91d409d659efa27eab8c41850201e7a9f13c07 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 10 Jun 2017 20:54:23 +1000 Subject: [PATCH] Fix SqlBagOStuff exptime uniqueness assumption The WMF parser cache tables have some 30000 rows with an identical, old expiry time. So each time deleteObjectsExpiringBefore() is run, the first batch on each table is correct, but the keys for the second batch are selected with exptime > X, where X is shared exptime of the many old rows. So, use exptime >= X instead. Change-Id: I6853f64f88f65d4529be2a42c9ed70cfa62cf653 --- includes/objectcache/SqlBagOStuff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index a4a6ba845a..6c103017d0 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -588,7 +588,7 @@ class SqlBagOStuff extends BagOStuff { while ( true ) { $conds = $baseConds; if ( $maxExpTime !== false ) { - $conds[] = 'exptime > ' . $db->addQuotes( $maxExpTime ); + $conds[] = 'exptime >= ' . $db->addQuotes( $maxExpTime ); } $rows = $db->select( $this->getTableNameByShard( $i ), -- 2.20.1