From 4c79d2e7e44cfd8242d0e2e2dea92a2cf74d8628 Mon Sep 17 00:00:00 2001 From: Sergio Santoro Date: Thu, 16 Oct 2014 20:43:38 +0200 Subject: [PATCH] SqlBagOStuff: fix percentage in deleteObjectsExpiringBefore() Partial deletion percentage progess was computed using $remainingSeconds. This is incorrect since $remainingSeconds is going to *decrease* ( instead of increase ) while the process continues. The correct implementation uses 'processed seconds' instead. Change-Id: Ic745f6e8375a85da543de36703fad6d31f62ea90 --- includes/objectcache/SqlBagOStuff.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index 3b0f8165d3..d8d86dbae3 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -621,7 +621,8 @@ class SqlBagOStuff extends BagOStuff { if ( $remainingSeconds > $totalSeconds ) { $totalSeconds = $remainingSeconds; } - $percent = ( $i + $remainingSeconds / $totalSeconds ) + $processedSeconds = $totalSeconds - $remainingSeconds; + $percent = ( $i + $processedSeconds / $totalSeconds ) / $this->shards * 100; } $percent = ( $percent / $this->numServers ) -- 2.20.1