[Pgpool-general] pgpool-II master/slave selection

Richard Yen dba at richyen.com
Wed May 9 22:28:14 UTC 2007


Hi All,

I'm quite a novice when it comes to reading the pgpool-II source  
code, so I'm looking for a little guidance, if you're willing to  
offer it.

I'd like to make a local change to the backend selection so that upon  
a write/update/delete, all read queries for the next X seconds will  
read from backend0 (master) database.

I'm doing this because our application can't allow users to  
experience any time delay between read and write (we use Slony-I for  
replication, so there's potentially a lag between writing to master  
and writing to slaves).  Making this 'sticky' feature would eliminate  
(or greatly reduce) that potential for lag.  I'm hoping to add a  
parameter to my pgpool.conf file, so I wouldn't have to hard-code it in.

Would anyone know which file(s) to look at, or where I would need to  
make the change(s)?  I've looked at pool_process_query.c and  
pool_config.c, but am having a little difficulty reading through the  
thousands of lines of code (I'm a complete novice at the C language).

Any assistance would be greatly appreciated!!!

Thanks!
--Richard


More information about the Pgpool-general mailing list