Hoo man has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387114 )

Change subject: Remove bogus "lock" condition from SqlChangeDispatchCoordinator 
query
......................................................................

Remove bogus "lock" condition from SqlChangeDispatchCoordinator query

This is a left over from e6c144530d8db040375c9096248675a177f48aa2,
which doesn't make any sense since then.

Note: Database::select ANDs the various criteria, thus is one
needed to be fullfiled.

Bug: T179060
Change-Id: Id34a6c7759c9292b9517e1df508c142b07c82838
---
M repo/includes/Store/Sql/SqlChangeDispatchCoordinator.php
M repo/tests/phpunit/includes/Store/Sql/SqlChangeDispatchCoordinatorTest.php
2 files changed, 7 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/14/387114/1

diff --git a/repo/includes/Store/Sql/SqlChangeDispatchCoordinator.php 
b/repo/includes/Store/Sql/SqlChangeDispatchCoordinator.php
index 8497b3d..e27c4f1 100644
--- a/repo/includes/Store/Sql/SqlChangeDispatchCoordinator.php
+++ b/repo/includes/Store/Sql/SqlChangeDispatchCoordinator.php
@@ -324,7 +324,6 @@
 
                // XXX: subject to clock skew. Use DB based "now" time?
                $freshDispatchTime = wfTimestamp( TS_MW, $this->now() - 
$this->dispatchInterval );
-               $staleLockTime = wfTimestamp( TS_MW, $this->now() - 
$this->lockGraceInterval );
 
                // TODO: pass the max change ID as a parameter!
                $row = $dbr->selectRow(
@@ -345,7 +344,6 @@
                // from the resulting list at random.
 
                $where = [
-                       'chd_touched < ' . $dbr->addQuotes( $staleLockTime ), 
// the lock is not old
                        '( chd_touched < ' . $dbr->addQuotes( 
$freshDispatchTime ) . // and wasn't touched too recently or
                                ' OR ( ' . (int)$maxId. ' - chd_seen ) > ' . 
(int)$this->batchSize . ') ' , // or it's lagging by more changes than batchSite
                        'chd_seen < ' . (int)$maxId, // and not fully up to 
date.
diff --git 
a/repo/tests/phpunit/includes/Store/Sql/SqlChangeDispatchCoordinatorTest.php 
b/repo/tests/phpunit/includes/Store/Sql/SqlChangeDispatchCoordinatorTest.php
index 945f979..8db1c3a 100644
--- a/repo/tests/phpunit/includes/Store/Sql/SqlChangeDispatchCoordinatorTest.php
+++ b/repo/tests/phpunit/includes/Store/Sql/SqlChangeDispatchCoordinatorTest.php
@@ -247,19 +247,19 @@
                                'chd_db' => 'nlwikidb',
                                'chd_seen' => '7',
                                'chd_touched' => '20140301070000',
-                               'chd_lock' => null,
+                               'chd_lock' => 'this-is-ignored',
                                'chd_disabled' => '0',
                        ],
                ];
 
-               $lockedRows = [
+               $disabledRows = [
                        'dewiki' => [
                                'chd_site' => 'dewiki',
                                'chd_db' => 'dewikidb',
                                'chd_seen' => '0',
                                'chd_touched' => '20140302235955',
-                               'chd_lock' => 'Foo.Bar', // locked
-                               'chd_disabled' => 0,
+                               'chd_lock' => null,
+                               'chd_disabled' => 1, // disabled
                        ],
                        'enwiki' => [
                                'chd_site' => 'enwiki',
@@ -290,11 +290,11 @@
                                        'chd_db' => 'nlwikidb',
                                        'chd_seen' => '7',
                                        'chd_touched' => '20140301070000',
-                                       'chd_lock' => null,
+                                       'chd_lock' => 'this-is-ignored',
                                ]
                        ],
-                       'locked or disabled' => [
-                               $lockedRows,
+                       'disabled' => [
+                               $disabledRows,
                                null
                        ],
                        'no pending changed' => [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id34a6c7759c9292b9517e1df508c142b07c82838
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>

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

Reply via email to