Replace cpPosTime cookie/parameter with cpPosIndex
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 8 Dec 2017 21:36:25 +0000 (13:36 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 3 Jan 2018 01:00:32 +0000 (17:00 -0800)
commitd5aa846d84e33967f086ef90a532243823b7b4a3
tree812d86a9c423a2803702411e298f265e27fec7de
parent80f7ac1ccfdf71801024eb904ce8e5166c4b1042
Replace cpPosTime cookie/parameter with cpPosIndex

This handles multi-DB transactions properly, instead of causing wait
timeouts in the WaitConditionLoop. It also is more correct in using
a counter instead of relying on wall clocks.

In addition:
* Refactor related code in MediaWiki.php to be comprehensible.
* Always send the cookie even the "remote wiki redirect" case.
* Renamed ChronologyProtector field and constant to avoid any
  confusion of "wait for server X to reach Y" with "wait for Y
  to show up in position store".
* Add an "asOfTime" field to the position keys for debugging.

Bug: T182322
Change-Id: I5c73cd07eaf664f02ba00c38fab9f49b609f4284
includes/MediaWiki.php
includes/Setup.php
includes/libs/rdbms/ChronologyProtector.php
includes/libs/rdbms/lbfactory/ILBFactory.php
includes/libs/rdbms/lbfactory/LBFactory.php
tests/phpunit/includes/db/LBFactoryTest.php