rdbms: add ILoadBalancer::getReplicaResumePos method
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 18 Jun 2019 23:57:32 +0000 (00:57 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Fri, 12 Jul 2019 17:16:15 +0000 (18:16 +0100)
commit318306ed1771d7ce6b6b8d7042ac0f3e3330eede
tree1c326d93422062cb21ce7a9e66832c4cf1d96146
parentdc8f3ec4ffbf2176d0a9a16b713f994cafb39af7
rdbms: add ILoadBalancer::getReplicaResumePos method

This does what ChronologyProtector wants more rigorously and is better
named. Not all replica servers will have the same position, so they
should be compared to get the highest one.

Simplify the getMasterPos() method to only return master positions
as the other current callers do not need anything else. It will now
connect if needed as well. This should make the method naming better.

Reducing the use of replica derived replication postitions (instead
of those from the master) makes certain GTID issues less likely,
such as the matter of obsolete domain IDs.

Increase general test coverage of LoadBalancer.

Bug: T224422
Change-Id: I5420721ee339a24d09c26c38709500c7bbe797c2
includes/libs/rdbms/ChronologyProtector.php
includes/libs/rdbms/lbfactory/LBFactory.php
includes/libs/rdbms/loadbalancer/ILoadBalancer.php
includes/libs/rdbms/loadbalancer/LoadBalancer.php
tests/phpunit/includes/db/LBFactoryTest.php
tests/phpunit/includes/db/LoadBalancerTest.php