
If a master with a better rank and a slave with a worse rank were available and master_accept_reads wasn't enabled, the slave would be preferred over the master. The check for master_accept_reads was done twice and also in the wrong place.
If a master with a better rank and a slave with a worse rank were available and master_accept_reads wasn't enabled, the slave would be preferred over the master. The check for master_accept_reads was done twice and also in the wrong place.