Bug #92161 Pooling not working with load balancing
Submitted: 23 Aug 2018 14:41
Reporter: Maxim Petrov Email Updates:
Status: Open Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:6.10.6 OS:Microsoft Windows
Assigned to: CPU Architecture:Any

[23 Aug 2018 14:41] Maxim Petrov
Description:
Hellow,
I have MySql master and two slave servers. I need call only-read procedures on slaves, for this I add ServerGroups:
<Replication>
      <ServerGroups>
        <Group name="Slaves">
          <Servers>
            <Server name="slave1" IsMaster="true" connectionstring="server=slavedb1.lan;User Id=login;password=pass;Persist Security Info=True;database=db;Keep Alive=3600;Minimum Pool Size=1;Maximum Pool Size=5;Connection Lifetime=300" />
            <Server name="slave2" IsMaster="true" connectionstring="server=slavedb2.lan;User Id=login;password=pass;Persist Security Info=True;database=db;Keep Alive=3600;Minimum Pool Size=1;Maximum Pool Size=5;Connection Lifetime=300" />
          </Servers>
        </Group>
      </ServerGroups>
    </Replication>

And make SQL request
using (myConn = new MySqlConnection("server=Slaves"))
{
	using (MySqlDataAdapter da = new MySqlDataAdapter(sql, myConn))
	{
		DataTable dt = new DataTable(name);
		da.Fill(dt);
		return dt;
	}
}

In this case pooling not working, and method 
public static Driver Create(MySqlConnectionStringBuilder settings)
called twice
first time: MySqlConnection -> Open -> ReplicationManager.GetNewConnection
second time: MySqlCommand -> ExecuteReader -> ReplicationManager.GetNewConnection

That is, for each procedure call, the connection opens twice. It is very big problem. 

How to repeat:
Described above