Bug #70467 | 6.8.3: pooling disabled when using new ReplicationManager | ||
---|---|---|---|
Submitted: | 30 Sep 2013 11:25 | Modified: | 25 May 2016 12:24 |
Reporter: | Moshe Lampert | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | Connector / NET | Severity: | S1 (Critical) |
Version: | 6.7.4, 6.8.3 | OS: | Windows (7, 2008 R2) |
Assigned to: | CPU Architecture: | Any | |
Tags: | pooling, replication |
[30 Sep 2013 11:25]
Moshe Lampert
[30 Sep 2013 11:26]
Moshe Lampert
update to critical (on production this version is usless) added OSses (7, r2)
[27 Nov 2013 0:38]
Roberto Ezequiel Garcia Ballesteros
Hi Moshe, I think the problem can be that you're using the methods directly. Please try to use replication as described in this post and let us know if this works: https://blogs.oracle.com/MySqlOnWindows/entry/how_to_using_replication_load Regards, Roberto
[27 Nov 2013 20:20]
Moshe Lampert
the problem is here again, here is the testcase: <?xml version="1.0"?> <configuration> <configSections> <section name="MySQL" type="MySql.Data.MySqlClient.MySqlConfiguration, MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> </configSections> <MySQL> <Replication> <ServerGroups> <Group name="MasterSlave"> <Servers> <Server name="master" IsMaster="true" connectionstring="server=;user id=; password=; database=a7; pooling=true ;Connection reset=false; Min Pool Size=2;Max Pool Size=60;Character Set=utf8; Connection Lifetime=0; UseAffectedRows=true; Connect Timeout=1;default command timeout=45;"/> <Server name="slave" IsMaster="false" connectionstring="server=;user id=; password=; database=a7; pooling=true ;Connection reset=false; Min Pool Size=2;Max Pool Size=60;Character Set=utf8; Connection Lifetime=0; UseAffectedRows=true; Connect Timeout=6;default command timeout=45;"/> </Servers> </Group> </ServerGroups> </Replication> </MySQL> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration> Module Module1 Sub Main() Dim lTasks As New List(Of task) For i = 0 To 1000 Step 1 Dim t As Task = New Task(AddressOf DoTask) lTasks.Add(t) t.Start() Next Console.WriteLine("starting tasks...") Task.WaitAll(lTasks.ToArray()) End Sub Sub DoTask() Console.WriteLine("begin task") Using Conn As New MySqlConnection("server=MasterSlave;database=db;") Conn.Open() Console.WriteLine("connected, database:" & Conn.Database) Thread.Sleep(1000) Conn.ChangeDatabase("db2") Console.WriteLine("connected, change:" & Conn.Database) Conn.ChangeDatabase("db") Dim Cmd = Conn.CreateCommand() Cmd.CommandText = "select * from table where pkid=1 limit 1" Using oReader = Cmd.ExecuteReader() oReader.Read() Console.Write(oReader("test") = "test text") End Using End Using End Sub End Module I tried a one task - works tried a two tasks (for i=0 to 1) - first works, second fail.
[21 Jan 2014 20:05]
Moshe Lampert
I retried the testcase with 6.8.3, and after some other tests I need to update the bug: XML: <MySQL> <Replication> <ServerGroups> <Group name="ConnString" retryTime="5"> <Servers> <Server name="master" IsMaster="true" connectionstring="server=master;user id=; password=;database=; pooling=true ;"/> <Server name="slave" IsMaster="false" connectionstring="server=slave;user id=; password=;database=; pooling=true ;"/"/> </Servers> </Group> </ServerGroups> </Replication> </MySQL> Test: Sub Main() Dim lTasks As New List(Of task) For i = 0 To 500 Step 1 Dim t As Task = New Task(AddressOf DoTask) lTasks.Add(t) t.Start() Next Console.WriteLine("starting tasks...") Task.WaitAll(lTasks.ToArray()) Console.Read() End Sub Sub DoTask() Console.WriteLine("begin task") ' I can use MySql.Data.MySqlClient.Replication.ReplicationManager.GetNewConnection("ConnString", False, Conn), same problem Using Conn As New MySqlConnection("server=ConnString") Conn.Open() Thread.Sleep(1000) Console.WriteLine(Conn.ServerThread) Conn.Close() End Using End Sub 6.7.4: connector lost pooled connections, and connections just waste client/server memory. 6.8.3: pooling disabled at all (ServerThread is always a new one). when I change connectionstring to a regular one without ReplicationManager, pooling return to work and I can see the numbers repeat itself.
[7 Oct 2014 7:33]
Moshe Lampert
something new related to this problem?
[25 May 2016 12:03]
Chiranjeevi Battula
Hello Moshe Lampert, Thank you for the bug report. This is most likely duplicate of Bug #77311, please see Bug #77311. Thanks, Chiranjeevi.
[25 May 2016 12:24]
Moshe Lampert
it can be the same problem from other aspect, but I opened this bug 2 years before...