Avoid unnecessary WaitConditionLoop delays in ChronologyProtector
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 10 May 2018 23:18:19 +0000 (16:18 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 18 May 2018 20:43:05 +0000 (13:43 -0700)
commit52af356cad3799ebec3826e1e4743d76a114da3e
treee14badb7c59b2d0d60a50df2bf9c2bdec1186c98
parentc70b1e9123b5513fc7d385e8e1eb2365e97468ef
Avoid unnecessary WaitConditionLoop delays in ChronologyProtector

Since it takes time for the agent to get the response and set the
cookie and, as well, the time into a request that a LoadBalancer is
initialized varies by many seconds (cookies loaded from the start),
give the cookie a much lower TTL than the DB positions in the stash.

This avoids having to wait for a position with a given cpPosIndex
value, when the position already expired from the store, which is
a waste of time.

Also include the timestamp in "cpPosIndex" cookies to implement
logical expiration in case clients do not expire them correctly.

Bug: T194403
Bug: T190082
Change-Id: I97d8f108dec59c5ccead66432a097cda8ef4a178
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