[Pgpool-general] [pgpool-general] load balancing for dummies

Guillaume Lelarge guillaume at lelarge.info
Mon Dec 14 07:42:36 UTC 2009


Le dimanche 13 décembre 2009 à 23:44:06, Jaime Casanova a écrit :
> [...]
> I'm looking at the load balancing and seems to me like is there a way
> to broke the sync of a replication using load balancing if a do
> something stupid like:
> 
> """
> create table t1(col1 date);
> 
> create table t_int(col1 int);
> insert into t_int select generate_series(1, 10);
> 
> create or replace function f1() returns integer as $$
>     insert into t1 values(current_date);
>     select 1;
> $$ language sql volatile;
> 
> select * from t_int where col1 = f1();
> """
> 
> the insert executed as a side effect in the function f1() could be
> sent to an slave instead of the master, something we can make to solve
> this?
> 

This is because pgpool only see the call to the function and has no way to 
know what the function could do. So, when you're using pgpool in load 
balancing mode, don't use functions that modify the database.


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com


More information about the Pgpool-general mailing list