rdbms: add replica server counting methods to ILoadBalancer
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 18 Jun 2019 21:12:06 +0000 (22:12 +0100)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 20 Jun 2019 11:47:23 +0000 (12:47 +0100)
commit69c503148f4103dc6a20ae712b0d3709f620a88c
tree4e855163cd1e8b3b8367e1d7b2a2398bd5832cd7
parent89b7bd3e93aedeb1f4af74481b72d19d1a9398c6
rdbms: add replica server counting methods to ILoadBalancer

This is slightly more robust and makes the intent much clearer
than random calling code checking getServerCount() all over the
place. In addition, this yields better separation of concern.

Also, cleanup the LoadBalancer constructer a bit and make the
validation a bit stricter.

Make some server index comparisons strict while at it.

Change-Id: Icc1a35bd65c6862ff81faa3ab9b2aa7cafe29443
includes/Revision/RevisionStore.php
includes/jobqueue/JobRunner.php
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