rdbms: merge openConnection into getConnection in LoadBalancer
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 17 Jun 2019 18:16:12 +0000 (19:16 +0100)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 19 Jun 2019 11:13:16 +0000 (11:13 +0000)
commit3cbb232c53971a66cb808df2767a2030e42b9e75
tree49f352fd201d1de6f49b722f2e2f199d171964f2
parent874cf5f355f11148a99846a5cf7feee52d99cdb4
rdbms: merge openConnection into getConnection in LoadBalancer

Add error suppression feature to getConnection() itself so that
callers can easily be migrated to it. Deprecate openConnection(),
which is poorly named and had a poor division of responsibility
with getConnection().

Split out some new private methods for readability:
* sanitizeConnectionFlags(), which warns about and strips unusable flags
* enforceConnectionFlags(), which handles some DBO_TRX sanity logic
* lazyLoadReplicationPositions(), which handles the chronology callback

Make sure "waitForPos" is loaded before pickReaderIndex() so that the
optimization of being extra picky about replication lag (in seconds)
actually applies.

Change-Id: I225ed6e6edf39cdf237f2322ea59f35d30f2e01a
includes/libs/rdbms/loadbalancer/ILoadBalancer.php
includes/libs/rdbms/loadbalancer/LoadBalancer.php
includes/libs/rdbms/loadmonitor/LoadMonitor.php