rdbms: clean up $groups logic in LoadBalancer and expand comments
Split out private resolveGroups() method for normalizing query
groups. Move some server index validation to getConnectionIndex()
and make it stricter.
Make getConnectionIndex() group fallback logic aware of the generic
group. The main use case for custom default groups is heavy scripts
or jobs that run in the background. It is probably better to have
good DB server redundancy for the query group and rely on it rather
than possibly fallback onto all of the main servers used for normal
requests. The later behavior could spread slowness or outages.
Also make getAnyOpenConnection() more robust and readable by
splitting out a private pickAnyOpenConnection() method that
checks IDatabase::trxLevel().
In addition, remove redundant is_int() check from isOpen()
method as it will return false in that case even without it.
Remove bogus getConnection() parameter in testCopyTestData().
Change-Id: Ica619c5487c761c724791d151db7388e4b41b0aa