MySQL Forums
Forum List  »  Router & Proxy

Re: Simple backend change in read_query
Posted by: riham mohsen
Date: May 14, 2008 04:46AM

What actually happens is that when you change the connection backend_ndx , the C method proxy_connection_set is called ... what this method does is the following:

if you reset backend_ndx = zero --> the connection is returned to the pool
else the method will attempt to find a connection from the connection pool associated with the backend you specified and it sets it as the connection.server
if it finds no connections in the pool it simply sets the backend_ndx & return

Now what your code does is that is changes the backend_ndx inside the read_query method and you maintain no connection pool for your connections at connect_server method

so when the C method is called, it attempts to associate your connection.server with one from the pool but it finds none so it simply changes the backend_ndx and returns

that is why you see the variable changed while the connection.server actually does not

& that is also why changing the backend_ndx inside read_query in rw-splitting & keep-alive work because they maintain a connection pool

-----------

Riham Mohsen, eSpace Technologies
http://www.espace.com.eg/



Edited 3 time(s). Last edit at 05/14/2008 04:54AM by riham mohsen.

Options: ReplyQuote


Subject
Views
Written By
Posted
4874
September 21, 2007 11:55AM
Re: Simple backend change in read_query
2782
May 14, 2008 04:46AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.