Bug #92161 Pooling not working with load balancing
Submitted: 23 Aug 2018 14:41 Modified: 11 Sep 2020 15:33
Reporter: Maxim Petrov Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:6.10.6 OS: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
[11 Aug 2020 15:33] MySQL Verification Team
Please try version 8.0.21. Thanks.
[12 Sep 2020 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".