Re: [Pgpool-general] PgPoolAdmin V2 beta 1 - Charset encoding Problem with French translation

2007-12-06 Thread Guillaume Lelarge
Hi,

Richard MICHALOWICZ a écrit :
> Im trying the PgPoolAdmin V2 beta 1 with success but i have a problem
> with charset encoding. Indeed, when i use the french translation, i have
> some bad characters in sentences with special characters like « é »
> « è » « ê » …
> 

You're right. fr.lang.php was not encoded in UTF-8. This is now done.
You can grab only this file on pgpool CVS server to get the new file.

Thanks for your report.

Regards.


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgpool-II documentation

2009-04-09 Thread Guillaume Lelarge
Le jeudi 09 avril 2009 à 03:03:08, Tatsuo Ishii a écrit :
> [...]
> Also I'm going to give a talk at PGCon 2009 in Ottawa. I would like to
> talk about how pgpool-II tries to keep the consistency among databases.

I'll be there too. That's one of the talk I want to attend.


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] backend mismatch

2009-07-16 Thread Guillaume Lelarge
Le jeudi 16 juillet 2009 à 15:48:58, Leonardo Carvalho a écrit :
>Unfortunately, PgAdmin always sends this commands , trying to use
> ISO date format.
>If you discover how to fix that in PgAdmin, tell us!
>

There's no way to fix that without recompiling. But you can try the patch 
attached.

I CC-ed pgadmin-hackers list so Dave can grab and check my patch :)

Regards.


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
Index: pgadmin/db/pgConn.cpp
===
--- pgadmin/db/pgConn.cpp	(révision 7968)
+++ pgadmin/db/pgConn.cpp	(copie de travail)
@@ -196,7 +196,9 @@
 PQsetNoticeProcessor(conn, pgNoticeProcessor, this);
 
 
-wxString sql=wxT("SET DateStyle=ISO;SELECT oid, pg_encoding_to_char(encoding) AS encoding, datlastsysoid\n")
+ExecuteVoid(wxT("SET DateStyle=ISO;"));
+
+wxString sql=wxT("SELECT oid, pg_encoding_to_char(encoding) AS encoding, datlastsysoid\n")
   wxT("  FROM pg_database WHERE ");
 
 if (oid)
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] [pgadmin-hackers] backend mismatch

2009-07-20 Thread Guillaume Lelarge
Le lundi 20 juillet 2009 à 17:50:53, Dave Page a écrit :
> On Thu, Jul 16, 2009 at 3:38 PM, Guillaume
>
> Lelarge wrote:
> > Le jeudi 16 juillet 2009 à 15:48:58, Leonardo Carvalho a écrit :
> >>Unfortunately, PgAdmin always sends this commands , trying to use
> >> ISO date format.
> >>If you discover how to fix that in PgAdmin, tell us!
> >
> > There's no way to fix that without recompiling. But you can try the patch
> > attached.
> >
> > I CC-ed pgadmin-hackers list so Dave can grab and check my patch :)
>
> Looks OK to me. What's the problem though - the SET, or having
> multiple command in one SQL query? If it's the latter, then that
> happens in a bunch of other places where it can't be fixed so easily.

The latter. I don't see a way to catch them all easily. I'll commit this, and 
try to find a way to catch the others.

Thanks.

(and welcome back :) )


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] [pgadmin-hackers] backend mismatch

2009-07-20 Thread Guillaume Lelarge
Le lundi 20 juillet 2009 à 19:06:50, Dave Page a écrit :
> On Mon, Jul 20, 2009 at 5:38 PM, Guillaume
>
> Lelarge wrote:
> > The latter. I don't see a way to catch them all easily. I'll commit this,
> > and try to find a way to catch the others.
>
> Good luck with that. We use multi-sentence statements in practically
> every SQL dialogue to group together commands like "CREATE xxx; ALTER
> xxx; COMMENT ON xxx;" to run everything as one transaction without
> explicitly starting or ending one. Changing that would require some
> fairly invasive changes.
>

H. You're right. I don't know why I didn't think about this. Should I 
revert my patch? it doesn't do any good (and no bad AFAICT).


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] [pgadmin-hackers] backend mismatch

2009-07-21 Thread Guillaume Lelarge
Le mardi 21 juillet 2009 à 10:12:37, Dave Page a écrit :
> On Mon, Jul 20, 2009 at 10:32 PM, Guillaume
>
> Lelarge wrote:
> > Le lundi 20 juillet 2009 à 19:06:50, Dave Page a écrit :
> >> On Mon, Jul 20, 2009 at 5:38 PM, Guillaume
> >>
> >> Lelarge wrote:
> >> > The latter. I don't see a way to catch them all easily. I'll commit
> >> > this, and try to find a way to catch the others.
> >>
> >> Good luck with that. We use multi-sentence statements in practically
> >> every SQL dialogue to group together commands like "CREATE xxx; ALTER
> >> xxx; COMMENT ON xxx;" to run everything as one transaction without
> >> explicitly starting or ending one. Changing that would require some
> >> fairly invasive changes.
> >
> > H. You're right. I don't know why I didn't think about this. Should I
> > revert my patch? it doesn't do any good (and no bad AFAICT).
>
> The downside is an extra roundtrip. If it doesn't help, let's back it out.

OK, I will do.


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


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

2009-12-13 Thread Guillaume Lelarge
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
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Database verification

2010-03-04 Thread Guillaume Lelarge
Le 04/03/2010 13:41, Christophe Philemotte a écrit :
>>> There exist some diff tools:
>>> - apgdiff http://apgdiff.sourceforge.net/
>>> - pgdiff http://pgdiff.sourceforge.net/
>>
>> Those are schema-wise. I think that Arjen means data-wise.
> you're rigth, I do not know data-wise diff. In fact, I've developped
> my solution to check if backends are synchronized or not. Do you think
> that could interest people? Or do you know an existing tool?
> 

AFAICT, rubyrep can do that. See http://www.rubyrep.org/ for details.


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Multi-statement queries

2010-03-05 Thread Guillaume Lelarge
Le 05/03/2010 09:45, Matthias Tief a écrit :
> Hallo,
> 
> we are planning to use pgpool-II as replication solution for our
> PostgeSQL application. Currently we evaluate, whether the restriction of
> pgpool-II affect our application. In the documentation you say:
> "pgpool-II cannot process multi-statement query." What do you exactly
> mean with "multi-statement queries". As I found out you don't mean
> transactions that contain multiple statments, like BEGIN - COMMIT
> blocks. These blocks are "committed" or in case of a failure are "rolled
> back" correctly. I would appreciate if you could give me an example of
> multi-statement queries.
> 

"statement1; statement2; statement3;" in a single trip to the backend.

For example:

"INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (2); INSERT INTO t1
VALUES (3);"

is a multi-statement query, whereas

"INSERT INTO t1 VALUES (1);"
then
"INSERT INTO t1 VALUES (2);"
then
"INSERT INTO t1 VALUES (3);"

are three one-statement queries.

pgAdmin uses this quite a lot ("SET client_encoding TO utf8; SELECT *
FROM...").


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] My blog regarding PostgreSQL and pgpool-II

2010-06-05 Thread Guillaume Lelarge
Le 05/06/2010 02:42, Tatsuo Ishii a écrit :
> [...]
> I just want to let you know that I have started my *first* English
> blog at: http://pgsqlpgpool.blogspot.com/.
> 
> I will post articles regarding PostgreSQL and pgpool-II.
> 

That's great news. I see that you already posted one article. I'm gonna
read this right away.

Have you considered to have it syndicated through Planet PostgreSQL? see
http://planet.postgresql.org/add.html for more details.

Regards.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Order of Query Results

2010-07-28 Thread Guillaume Lelarge
Le 28/07/2010 16:50, Sean Brown a écrit :
> Does PgPool have an issue with the order of results from a query being 
> returned in a different order?
> 
> With the ongoing issue of our cluster falling out, we just had one member 
> fall 
> out again and again, no error in PostgreSQLs log is recorded. PgPool reports 
> the possible last query was:
> select * from carts where cart_id in (11835,11824,11819)
> 
> Specifically the error in PgPools log is:
> read_kind_from_backend: 1 th kind D does not match with master or majority 
> connection kind ^@
> 2010-07-28 10:21:23 ERROR: pid 28242: kind mismatch among backends. Possible 
> last query was: "select * from carts where cart_id in (11835,11824,11819)" 
> kind details are: 1[D]
> 
> If I run that query on the remaining node and on the one that just fell out, 
> I 
> get the same 3 results, but the orders of the records are different.
> 

The query you show doesn't ask for a specific order (no "ORDER BY"
clause), so each backend can send the data in whatever order they "prefer".


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Order of Query Results

2010-07-28 Thread Guillaume Lelarge
Le 28/07/2010 17:16, Sean Brown a écrit :
> On Wednesday, July 28, 2010 10:56:27 am you wrote:
>> Le 28/07/2010 16:50, Sean Brown a écrit :
>>> Does PgPool have an issue with the order of results from a query being
>>> returned in a different order?
>>>
>>> With the ongoing issue of our cluster falling out, we just had one member
>>> fall out again and again, no error in PostgreSQLs log is recorded.
>>> PgPool reports the possible last query was:
>>> select * from carts where cart_id in (11835,11824,11819)
>>>
>>> Specifically the error in PgPools log is:
>>> read_kind_from_backend: 1 th kind D does not match with master or
>>> majority connection kind ^@
>>> 2010-07-28 10:21:23 ERROR: pid 28242: kind mismatch among backends.
>>> Possible last query was: "select * from carts where cart_id in
>>> (11835,11824,11819)" kind details are: 1[D]
>>>
>>> If I run that query on the remaining node and on the one that just fell
>>> out, I get the same 3 results, but the orders of the records are
>>> different.
>>
>> The query you show doesn't ask for a specific order (no "ORDER BY"
>> clause), so each backend can send the data in whatever order they "prefer".
> 
> That I understand, what I am wondering is if this will cause PgPool to 
> believe 
> there is an error in the information returned from the backends, even if the 
> only difference is the difference in order?
> 
> If it does, I assume the best way to deal with it is add order by's to every 
> query passed to pgpool?
> 

That's actually really good questions, and I don't have an answer to
them. CC back the list to know if other people have an answer to give us.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Setting up connections config for load-balancing

2010-08-13 Thread Guillaume Lelarge
Le 13/08/2010 03:02, Josh Berkus a écrit :
> 
>>> Hmmm.  You might want to display a more user-friendly value for the
>>> user, though, no?
>>
>> Good point:-) I'm thinking about to change it for coming 3.0.
> 
> Great!  Might I also suggest using getopt-long for the PCP commands?
> 

That's already done in 3.0 (for the usual ones, like --help or --debug).


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgpool-II 3.0 and getopt.h missing on SCO 5.0.7

2010-08-20 Thread Guillaume Lelarge
Le 20/08/2010 01:49, Tatsuo Ishii a écrit :
>> hi!  i tried to compile pgpool-II 3.0 beta1 on SCO 5.0.7 , buti 
>> can't find  getopt.h file ,  i just  have an getopt_.h from gnulib but  
>> is not enough to compile it.
>>
>> There is a  way to disable long options?
>> or
>> where can  i find a getopt.h file (and getopt.c to  compile. ;-) ) ??
> 
> I have looked into PostgreSQL code, and found that it spends lots of
> efforts to make long options portable.
> 
> Guillaume, should we do the same thing?

Seems a good idea. Working on it.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgpool-II 3.0 and getopt.h missing on SCO 5.0.7

2010-08-20 Thread Guillaume Lelarge
Le 20/08/2010 15:04, Guillaume Lelarge a écrit :
> Le 20/08/2010 01:49, Tatsuo Ishii a écrit :
>>> hi!  i tried to compile pgpool-II 3.0 beta1 on SCO 5.0.7 , buti 
>>> can't find  getopt.h file ,  i just  have an getopt_.h from gnulib but  
>>> is not enough to compile it.
>>>
>>> There is a  way to disable long options?
>>> or
>>> where can  i find a getopt.h file (and getopt.c to  compile. ;-) ) ??
>>
>> I have looked into PostgreSQL code, and found that it spends lots of
>> efforts to make long options portable.
>>
>> Guillaume, should we do the same thing?
> 
> Seems a good idea. Working on it.
> 

Well, it shouldn't be a hard work for someone who knows how to write the
configure file, but it happens that I don't. I tried a few things, but
it didn't work out well.

In the source file, there's only one thing to do. Instead of

#include 

we should have a

#include "getopt_long.h"

Of course, we also need to copy the getopt_long.c and getopt_lon.h
source files.

And it's enough if the configure script is in good shape. Can you take
care of the configure script? or at least tell me the files that need
some updates.

The only place where I found pgpool's licence is on the pgfoundry
website. We certainly need to mention it in the docs too.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgpool-II 3.0 and getopt.h missing on SCO 5.0.7

2010-08-21 Thread Guillaume Lelarge
Le 21/08/2010 09:25, Tatsuo Ishii a écrit :
>> Le 20/08/2010 15:04, Guillaume Lelarge a écrit :
>>> Le 20/08/2010 01:49, Tatsuo Ishii a écrit :
>>>>> hi!  i tried to compile pgpool-II 3.0 beta1 on SCO 5.0.7 , buti 
>>>>> can't find  getopt.h file ,  i just  have an getopt_.h from gnulib but  
>>>>> is not enough to compile it.
>>>>>
>>>>> There is a  way to disable long options?
>>>>> or
>>>>> where can  i find a getopt.h file (and getopt.c to  compile. ;-) ) ??
>>>>
>>>> I have looked into PostgreSQL code, and found that it spends lots of
>>>> efforts to make long options portable.
>>>>
>>>> Guillaume, should we do the same thing?
>>>
>>> Seems a good idea. Working on it.
>>>
>>
>> Well, it shouldn't be a hard work for someone who knows how to write the
>> configure file, but it happens that I don't. I tried a few things, but
>> it didn't work out well.
>>
>> In the source file, there's only one thing to do. Instead of
>>
>> #include 
>>
>> we should have a
>>
>> #include "getopt_long.h"
>>
>> Of course, we also need to copy the getopt_long.c and getopt_lon.h
>> source files.
>>
>> And it's enough if the configure script is in good shape. Can you take
>> care of the configure script? or at least tell me the files that need
>> some updates.
>>
>> The only place where I found pgpool's licence is on the pgfoundry
>> website. We certainly need to mention it in the docs too.
> 
> We already have:
> 
> /* Define to 1 if you have the  header file. */
> #define HAVE_GETOPT_H 1
> 
> So probably in main.c and etc. we should do:
> 
> #ifdef HAVE_GETOPT_H
> #include 
> #else
> #include "getopt_long.h"
> :
> :
> 
> What else do you need?

Nothing. It's great :)

See patch attached.
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese: http://www.sraoss.co.jp
> 


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
Index: Makefile.am
===
RCS file: /cvsroot/pgpool/pgpool-II/Makefile.am,v
retrieving revision 1.43
diff -c -p -r1.43 Makefile.am
*** Makefile.am	12 Aug 2010 06:36:17 -	1.43
--- Makefile.am	21 Aug 2010 16:07:20 -
*** pgpool_SOURCES = pool.h pool_type.h vers
*** 21,27 
  	pool_worker_child.c \
  	pool_passwd.c pool_passwd.h \
  	pool_globals.c \
! 	pool_select_walker.c pool_select_walker.h
  
  pg_md5_SOURCES = pg_md5.c md5.c md5.h \
  	pool.h \
--- 21,28 
  	pool_worker_child.c \
  	pool_passwd.c pool_passwd.h \
  	pool_globals.c \
! 	pool_select_walker.c pool_select_walker.h \
! getopt_long.c getopt_long.h
  
  pg_md5_SOURCES = pg_md5.c md5.c md5.h \
  	pool.h \
Index: Makefile.in
===
RCS file: /cvsroot/pgpool/pgpool-II/Makefile.in,v
retrieving revision 1.46
diff -c -p -r1.46 Makefile.in
*** Makefile.in	12 Aug 2010 06:36:17 -	1.46
--- Makefile.in	21 Aug 2010 16:07:20 -
*** am_pgpool_OBJECTS = main.$(OBJEXT) child
*** 82,88 
  	pool_process_context.$(OBJEXT) pool_session_context.$(OBJEXT) \
  	pool_query_context.$(OBJEXT) pool_worker_child.$(OBJEXT) \
  	pool_passwd.$(OBJEXT) pool_globals.$(OBJEXT) \
! 	pool_select_walker.$(OBJEXT)
  pgpool_OBJECTS = $(am_pgpool_OBJECTS)
  pgpool_DEPENDENCIES = parser/libsql-parser.a pcp/libpcp.la \
  	parser/nodes.o
--- 82,88 
  	pool_process_context.$(OBJEXT) pool_session_context.$(OBJEXT) \
  	pool_query_context.$(OBJEXT) pool_worker_child.$(OBJEXT) \
  	pool_passwd.$(OBJEXT) pool_globals.$(OBJEXT) \
! 	pool_select_walker.$(OBJEXT) getopt_long.$(OBJEXT)
  pgpool_OBJECTS = $(am_pgpool_OBJECTS)
  pgpool_DEPENDENCIES = parser/libsql-parser.a pcp/libpcp.la \
  	parser/nodes.o
*** pgpool_SOURCES = pool.h pool_type.h vers
*** 261,267 
  	pool_worker_child.c \
  	pool_passwd.c pool_passwd.h \
  	pool_globals.c \
! 	pool_select_walker.c pool_select_walker.h
  
  pg_md5_SOURCES = pg_md5.c md5.c md5.h \
  	pool.h \
--- 261,268 
  	pool_worker_child.c \
  	pool_passwd.c pool_passwd.h \
  	pool_globals.c \
! 	pool_select_walker.c pool_select_walker.h \
! getopt_long.c getopt_long.h
  
  pg_md5_SOURCES = pg_md5.c md5.c md5.h \
  	pool.h \
*** distclean-compile:
*** 457,462 
--- 458,464 
  @AMDEP_TRUE@@am__include@ @am__qu...@./$(DEPDIR)/ps_status...@am__quote@
  @AMDEP_TRUE@@am__include@ @am__qu...@./$(DEPDIR)/recovery...@am__quote@
  @AMDEP_TRUE@@am__include@ @am__qu...@./$(DEPDIR)/strlcpy...@am__quote@
+ @AMDEP_TRUE@@am__include@ 

Re: [Pgpool-general] pgpool-II 3.0 and getopt.h missing on SCO 5.0.7

2010-08-21 Thread Guillaume Lelarge
Le 21/08/2010 18:08, Guillaume Lelarge a écrit :
> Le 21/08/2010 09:25, Tatsuo Ishii a écrit :
>>> Le 20/08/2010 15:04, Guillaume Lelarge a écrit :
>>>> Le 20/08/2010 01:49, Tatsuo Ishii a écrit :
>>>>>> hi!  i tried to compile pgpool-II 3.0 beta1 on SCO 5.0.7 , buti 
>>>>>> can't find  getopt.h file ,  i just  have an getopt_.h from gnulib but  
>>>>>> is not enough to compile it.
>>>>>>
>>>>>> There is a  way to disable long options?
>>>>>> or
>>>>>> where can  i find a getopt.h file (and getopt.c to  compile. ;-) ) ??
>>>>>
>>>>> I have looked into PostgreSQL code, and found that it spends lots of
>>>>> efforts to make long options portable.
>>>>>
>>>>> Guillaume, should we do the same thing?
>>>>
>>>> Seems a good idea. Working on it.
>>>>
>>>
>>> Well, it shouldn't be a hard work for someone who knows how to write the
>>> configure file, but it happens that I don't. I tried a few things, but
>>> it didn't work out well.
>>>
>>> In the source file, there's only one thing to do. Instead of
>>>
>>> #include 
>>>
>>> we should have a
>>>
>>> #include "getopt_long.h"
>>>
>>> Of course, we also need to copy the getopt_long.c and getopt_lon.h
>>> source files.
>>>
>>> And it's enough if the configure script is in good shape. Can you take
>>> care of the configure script? or at least tell me the files that need
>>> some updates.
>>>
>>> The only place where I found pgpool's licence is on the pgfoundry
>>> website. We certainly need to mention it in the docs too.
>>
>> We already have:
>>
>> /* Define to 1 if you have the  header file. */
>> #define HAVE_GETOPT_H 1
>>
>> So probably in main.c and etc. we should do:
>>
>> #ifdef HAVE_GETOPT_H
>> #include 
>> #else
>> #include "getopt_long.h"
>> :
>> :
>>
>> What else do you need?
> 
> Nothing. It's great :)
> 
> See patch attached.

Sorry, clicked on the wrong button. You also need these two files.

There are some warnings. I'll work on them. But I'll like to know if
Edmundo can try the patch to see if it's working for him. I don't have a
platform that doesn't have getopt_long. If yes, he can try right now.

Thanks.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
/*
 * getopt_long() -- long options parser
 *
 * Portions Copyright (c) 1987, 1993, 1994
 * The Regents of the University of California.  All rights reserved.
 *
 * Portions Copyright (c) 2003
 * PostgreSQL Global Development Group
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *	  notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *	  notice, this list of conditions and the following disclaimer in the
 *	  documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the University nor the names of its contributors
 *	  may be used to endorse or promote products derived from this software
 *	  without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.	IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * $PostgreSQL: pgsql/src/port/getopt_long.c,v 1.8 2009-06-11 14:49:15 momjian Exp $
 */

#include 

#include "getopt_long.h"

#ifndef HAVE_INT_OPTRESET
int			optreset;

/* else the "extern" was provided by getopt_long.h */
#endif

#define BADCH	'?'
#define BADARG	':'
#define EMSG	""


int
getopt_long(int argc, char *const argv[],
			const char *optstring,
			const struct option * longopts, int *

Re: [Pgpool-general] pgpool-II 3.0 and getopt.h missing on SCO 5.0.7

2010-08-21 Thread Guillaume Lelarge
Le 22/08/2010 00:35, Tatsuo Ishii a écrit :
>> Le 21/08/2010 09:25, Tatsuo Ishii a écrit :
>>>> Le 20/08/2010 15:04, Guillaume Lelarge a écrit :
>>>>> Le 20/08/2010 01:49, Tatsuo Ishii a écrit :
>>>>>>> hi!  i tried to compile pgpool-II 3.0 beta1 on SCO 5.0.7 , buti 
>>>>>>> can't find  getopt.h file ,  i just  have an getopt_.h from gnulib but  
>>>>>>> is not enough to compile it.
>>>>>>>
>>>>>>> There is a  way to disable long options?
>>>>>>> or
>>>>>>> where can  i find a getopt.h file (and getopt.c to  compile. ;-) ) ??
>>>>>>
>>>>>> I have looked into PostgreSQL code, and found that it spends lots of
>>>>>> efforts to make long options portable.
>>>>>>
>>>>>> Guillaume, should we do the same thing?
>>>>>
>>>>> Seems a good idea. Working on it.
>>>>>
>>>>
>>>> Well, it shouldn't be a hard work for someone who knows how to write the
>>>> configure file, but it happens that I don't. I tried a few things, but
>>>> it didn't work out well.
>>>>
>>>> In the source file, there's only one thing to do. Instead of
>>>>
>>>> #include 
>>>>
>>>> we should have a
>>>>
>>>> #include "getopt_long.h"
>>>>
>>>> Of course, we also need to copy the getopt_long.c and getopt_lon.h
>>>> source files.
>>>>
>>>> And it's enough if the configure script is in good shape. Can you take
>>>> care of the configure script? or at least tell me the files that need
>>>> some updates.
>>>>
>>>> The only place where I found pgpool's licence is on the pgfoundry
>>>> website. We certainly need to mention it in the docs too.
>>>
>>> We already have:
>>>
>>> /* Define to 1 if you have the  header file. */
>>> #define HAVE_GETOPT_H 1
>>>
>>> So probably in main.c and etc. we should do:
>>>
>>> #ifdef HAVE_GETOPT_H
>>> #include 
>>> #else
>>> #include "getopt_long.h"
>>> :
>>> :
>>>
>>> What else do you need?
>>
>> Nothing. It's great :)
>>
>> See patch attached.
> 
> Thanks. But I cannot find getopt_long.c etc. in the patch?

Yeah, The first email
(http://lists.pgfoundry.org/pipermail/pgpool-general/2010-August/002901.html)
only has the diff, the second mail
(http://lists.pgfoundry.org/pipermail/pgpool-general/2010-August/002902.html)
has the getopt_long.h and getopt_long.c files.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgpool-II 3.0 and getopt.h missing on SCO 5.0.7

2010-08-22 Thread Guillaume Lelarge
Le 22/08/2010 08:36, Tatsuo Ishii a écrit :
>> Le 22/08/2010 00:35, Tatsuo Ishii a écrit :
>>>> Le 21/08/2010 09:25, Tatsuo Ishii a écrit :
>>>>>> Le 20/08/2010 15:04, Guillaume Lelarge a écrit :
>>>>>>> Le 20/08/2010 01:49, Tatsuo Ishii a écrit :
>>>>>>>>> hi!  i tried to compile pgpool-II 3.0 beta1 on SCO 5.0.7 , buti 
>>>>>>>>> can't find  getopt.h file ,  i just  have an getopt_.h from gnulib 
>>>>>>>>> but  
>>>>>>>>> is not enough to compile it.
>>>>>>>>>
>>>>>>>>> There is a  way to disable long options?
>>>>>>>>> or
>>>>>>>>> where can  i find a getopt.h file (and getopt.c to  compile. ;-) ) ??
>>>>>>>>
>>>>>>>> I have looked into PostgreSQL code, and found that it spends lots of
>>>>>>>> efforts to make long options portable.
>>>>>>>>
>>>>>>>> Guillaume, should we do the same thing?
>>>>>>>
>>>>>>> Seems a good idea. Working on it.
>>>>>>>
>>>>>>
>>>>>> Well, it shouldn't be a hard work for someone who knows how to write the
>>>>>> configure file, but it happens that I don't. I tried a few things, but
>>>>>> it didn't work out well.
>>>>>>
>>>>>> In the source file, there's only one thing to do. Instead of
>>>>>>
>>>>>> #include 
>>>>>>
>>>>>> we should have a
>>>>>>
>>>>>> #include "getopt_long.h"
>>>>>>
>>>>>> Of course, we also need to copy the getopt_long.c and getopt_lon.h
>>>>>> source files.
>>>>>>
>>>>>> And it's enough if the configure script is in good shape. Can you take
>>>>>> care of the configure script? or at least tell me the files that need
>>>>>> some updates.
>>>>>>
>>>>>> The only place where I found pgpool's licence is on the pgfoundry
>>>>>> website. We certainly need to mention it in the docs too.
>>>>>
>>>>> We already have:
>>>>>
>>>>> /* Define to 1 if you have the  header file. */
>>>>> #define HAVE_GETOPT_H 1
>>>>>
>>>>> So probably in main.c and etc. we should do:
>>>>>
>>>>> #ifdef HAVE_GETOPT_H
>>>>> #include 
>>>>> #else
>>>>> #include "getopt_long.h"
>>>>> :
>>>>> :
>>>>>
>>>>> What else do you need?
>>>>
>>>> Nothing. It's great :)
>>>>
>>>> See patch attached.
>>>
>>> Thanks. But I cannot find getopt_long.c etc. in the patch?
>>
>> Yeah, The first email
>> (http://lists.pgfoundry.org/pipermail/pgpool-general/2010-August/002901.html)
>> only has the diff, the second mail
>> (http://lists.pgfoundry.org/pipermail/pgpool-general/2010-August/002902.html)
>> has the getopt_long.h and getopt_long.c files.
> 
> Sorry I missed it. Ok let's commit and see if this solves Edmundo's
> problem.

Done.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgpool-II 3.0 and getopt.h missing on SCO 5.0.7

2010-08-24 Thread Guillaume Lelarge
Le 24/08/2010 15:50, Edmundo Robles L. a écrit :
> 
> 
> On 08/22/2010 03:43 AM, Tatsuo Ishii wrote:
>>> Le 22/08/2010 08:36, Tatsuo Ishii a �crit :
>>>  
>>>>> Le 22/08/2010 00:35, Tatsuo Ishii a �crit :
>>>>>  
>>>>>>> Le 21/08/2010 09:25, Tatsuo Ishii a �crit :
>>>>>>>  
>>>>>>>>> Le 20/08/2010 15:04, Guillaume Lelarge a �crit :
>>>>>>>>>  
>>>>>>>>>> Le 20/08/2010 01:49, Tatsuo Ishii a �crit :
>>>>>>>>>>
>>>>>>>>>>>> hi!  i tried to compile pgpool-II 3.0 beta1 on SCO 5.0.7 , buti
>>>>>>>>>>>> can't find  getopt.h file ,  i just  have an getopt_.h from gnulib 
>>>>>>>>>>>> but
>>>>>>>>>>>> is not enough to compile it.
>>>>>>>>>>>>
>>>>>>>>>>>> There is a  way to disable long options?
>>>>>>>>>>>> or
>>>>>>>>>>>> where can  i find a getopt.h file (and getopt.c to  compile. ;-) ) 
>>>>>>>>>>>> ??
>>>>>>>>>>>>
>>>>>>>>>>> I have looked into PostgreSQL code, and found that it spends lots of
>>>>>>>>>>> efforts to make long options portable.
>>>>>>>>>>>
>>>>>>>>>>> Guillaume, should we do the same thing?
>>>>>>>>>>>  
>>>>>>>>>> Seems a good idea. Working on it.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> Well, it shouldn't be a hard work for someone who knows how to write 
>>>>>>>>> the
>>>>>>>>> configure file, but it happens that I don't. I tried a few things, but
>>>>>>>>> it didn't work out well.
>>>>>>>>>
>>>>>>>>> In the source file, there's only one thing to do. Instead of
>>>>>>>>>
>>>>>>>>> #include
>>>>>>>>>
>>>>>>>>> we should have a
>>>>>>>>>
>>>>>>>>> #include "getopt_long.h"
>>>>>>>>>
>>>>>>>>> Of course, we also need to copy the getopt_long.c and getopt_lon.h
>>>>>>>>> source files.
>>>>>>>>>
>>>>>>>>> And it's enough if the configure script is in good shape. Can you take
>>>>>>>>> care of the configure script? or at least tell me the files that need
>>>>>>>>> some updates.
>>>>>>>>>
>>>>>>>>> The only place where I found pgpool's licence is on the pgfoundry
>>>>>>>>> website. We certainly need to mention it in the docs too.
>>>>>>>>>  
>>>>>>>> We already have:
>>>>>>>>
>>>>>>>> /* Define to 1 if you have the  header file. */
>>>>>>>> #define HAVE_GETOPT_H 1
>>>>>>>>
>>>>>>>> So probably in main.c and etc. we should do:
>>>>>>>>
>>>>>>>> #ifdef HAVE_GETOPT_H
>>>>>>>> #include
>>>>>>>> #else
>>>>>>>> #include "getopt_long.h"
>>>>>>>> :
>>>>>>>> :
>>>>>>>>
>>>>>>>> What else do you need?
>>>>>>>>
>>>>>>> Nothing. It's great :)
>>>>>>>
>>>>>>> See patch attached.
>>>>>>>  
>>>>>> Thanks. But I cannot find getopt_long.c etc. in the patch?
>>>>>>
>>>>> Yeah, The first email
>>>>> (http://lists.pgfoundry.org/pipermail/pgpool-general/2010-August/002901.html)
>>>>> only has the diff, the second mail
>>>>> (http://lists.pgfoundry.org/pipermail/pgpool-general/2010-August/002902.html)
>>>>> has the getopt_long.h and getopt_long.c files.
>>>>>  
>>>> Sorry I missed it. Ok let's commit and see if this solves Edmundo's
>>>> problem.
>>>>
>>> Done.
>>>  
>> Thanks!
>>
>>
> 
> Hi!
> Just to say that sources files including getopt_long.h  already 
> compiled,  only just need test them.
> in brief,  i have a lot of work ,i will upload   the changes made in the 
> Makefile, config.h as well as the source , please tell me where I  
> upload them.
> 

I don't understand. What changes?


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgpool-II 3.0 and Postgres 9.0

2010-09-25 Thread Guillaume Lelarge
Le 25/09/2010 22:36, Duncan McQueen a écrit :
> I see the new version of pgpool-II includes some support for postgres
> 9.0.  I just installed the binary for postgres, but configure fails
> when trying to find libpq (since postgres is installed in /opt).
> Specifically. this fails:
> 
> ./configure --with-pgsql-includedir=/opt/PostgreSQL/9.0/include/
> --with-pgsql-libdir=/opt/PostgreSQL/9.0/lib/
> 
> 
> Any ideas as to why?

Well, as you didn't tell us what the error message was exactly, one
could just guess.

Why don't you use the simpler --with-pgsql command-line option? this way
for example:

./configure --with-pgsql=/opt/PostgreSQL/9.0

I know it works for me.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] [Pgpool-hackers] First try at rephrasing the documentation

2010-12-17 Thread Guillaume Lelarge
Le 18/12/2010 01:47, Tatsuo Ishii a écrit :
> [...]
>> I did the work on pgpoolII-3.0.1's doc, by the way.
> 
> In the mean time, I think Jean-Paul Argudo is translating the doc to
> French and if my memory is correct, he is trying to fix the English
> doc as well. Is it possible for you and Jean to work together to
> enhance the English doc?

They already do. They know each other, they work on the same company.
And so do I.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgpool log file

2011-01-10 Thread Guillaume Lelarge
Hi,

Le 10/01/2011 11:28, Armin Nesiren a écrit :
> [...]
> I have problem with pgpool.log file.
> I have specify 'logdir' in pgpool.conf file
> logdir = '/var/log/pgpool'
> but, pgpool wont write any log file into it.
> 
> /var/log/pgpool/ have mode 777, so everyone can write into it.
> I have try to manually add pgpool.log into in, with no success.
> 
> What am I doing wrong?
> 

logdir isn't used for a directory of log files. AFAIR, it is only used
for the pool_status file.

We wish to change this for next release.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Why need set 'slony' submode in pgpool.conf

2011-01-12 Thread Guillaume Lelarge
Le 12/01/2011 09:40, Zhidong She a écrit :
> Hi Guys,
> 
> I'm just a little confused about master_slave_sub_mode option in
> configuration file.
> If we build a master/slave db replication and deploy pgpool on top of
> them, we need set master_slave_mode to true. It does make sence.
> But why does PgPool need to set "slony" sub mode? What's the purpose
> of this option for pgpool?
> I think if we use master/slave mode in pgpool, it's the DB's
> responsibility to build a master/slave replication using slony or log
> streaming. Pgpool doesn't care about how the data is replicated
> between master and slave.
> 

I didn't check in the code (don't have the time right now), but I guess
it's needed for pgpool to know if it needs to use some advanced
features, like getting the lag between a master and a slave to "disable"
a node with too much lag. Which, IIUI, is only available in streaming mode.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] replication/failover feature in Master/Slave mode

2011-01-12 Thread Guillaume Lelarge
Hi,

Le 12/01/2011 15:10, Sandeep Thakkar a écrit :
> [...]
> I have a primary and a standby server on different boxes and both are running 
> on 
> different ports. I would like to use pgpool for Streaming Replication and 
> Failover. Hence, I selected Master/Slave mode with stream. Now, I have a 
> question, if I write anything on primary, how will the data be replicated on 
> standby? Will it happen automatically like it does in replication mode Or do 
> I 
> need to look into Hot Standby feature of PG?
> 

You need to look at the streaming replication feature of PostgreSQL. You
need Hot Standby for example if you want to use the load balacing
feature of pgPool.

> Also, on failover (let's say primary goes down for some reason), and the 
> standby 
> now takes over. Will the standby has write operations?
> 

You need to write scripts for that.

> Also, in my application, will I use the pgpool port, so that I do not need to 
> change the configuration file in case of failover?? With Slony, we had to 
> tell 
> the application to use the other port.
> 

The pgpool port, always.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Query regarding load balancing

2011-01-14 Thread Guillaume Lelarge
Le 14/01/2011 10:16, Sandeep Thakkar a écrit :
> [...]
> I'm using PG9.0 and pgpool-3.0.1 and I have setup a master and a standby 
> servers. Standby server is configured for Hot Standby and Stream replication. 
> I'm using pgpool in Master/Slave mode with Load balancing mode on. I would 
> like 
> to execute few queries using pgpool port and I would like to see which server 
> has served that query. I think, the read only queries should go to Standby 
> and 
> Insert/Update and some others should go to the Master. But how do I confirm 
> this? I checked the server logs, but I did not find anything. In pgpool log, 
> I 
> could see information like "wait_for_query_response", but I did not 
> understand. 
> 

The easier way is to enable queries log on both PostgreSQL nodes. BTW,
read queries are executed by the master node or by the standby node, not
only by the node unless you set the weight to 0 on the master node
configuration.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] sql to know if connection is using pgpool

2011-01-18 Thread Guillaume Lelarge
Le 18/01/2011 16:16, Gary Fu a écrit :
>  On 01/17/11 19:45, Tatsuo Ishii wrote:
>>> Is there a simple query (not the 'show' command) to tell if my current
>>> db connection is using pgpool ?
>> No. Why is show pool_status not good?
> 
> It causes error when the connection is not using pgpool.
> 

You can try to compare inet_server_addr() and inet_server_port() with
the address and port your connected to.

Here is an example (PostgreSQL 9.0.2 on 127.0.0.1:5432, pgPool 3.0.1 on
127.0.0.1:).

guillaume@laptop:/opt/pgpool-head$ psql -h 127.0.0.1 -p  b1
psql (9.0.2)
Type "help" for help.

b1=# select inet_server_addr() as ip, inet_server_port() as port,
inet_server_addr() <> '127.0.0.1' or inet_server_port() <>  as
through_pgpool;
ip | port | through_pgpool
---+--+
 127.0.0.1 | 5432 | t
(1 row)

b1=# \q
guillaume@laptop:/opt/pgpool-head$ psql -h 127.0.0.1 -p 5432 b1
psql (9.0.2)
Type "help" for help.

b1=# select inet_server_addr() as ip, inet_server_port() as port,
inet_server_addr() <> '127.0.0.1' or inet_server_port() <> 5432 as
through_pgpool;
ip | port | through_pgpool
---+--+
 127.0.0.1 | 5432 | f
(1 row)


The "through_pgpool" column tells me if I'm connected using pgPool or
not. Actually, it won't handle every case (for example it won't if you
connect through an SSH tunnel).


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] sql to know if connection is using pgpool

2011-01-18 Thread Guillaume Lelarge
Le 18/01/2011 22:06, Gary Fu a écrit :
>  On 01/18/11 15:35, Guillaume Lelarge wrote:
>> Le 18/01/2011 16:16, Gary Fu a écrit :
>>>   On 01/17/11 19:45, Tatsuo Ishii wrote:
>>>>> Is there a simple query (not the 'show' command) to tell if my current
>>>>> db connection is using pgpool ?
>>>> No. Why is show pool_status not good?
>>> It causes error when the connection is not using pgpool.
>>>
>> You can try to compare inet_server_addr() and inet_server_port() with
>> the address and port your connected to.
>>
>> Here is an example (PostgreSQL 9.0.2 on 127.0.0.1:5432, pgPool 3.0.1 on
>> 127.0.0.1:).
>>
>> guillaume@laptop:/opt/pgpool-head$ psql -h 127.0.0.1 -p  b1
>> psql (9.0.2)
>> Type "help" for help.
>>
>> b1=# select inet_server_addr() as ip, inet_server_port() as port,
>> inet_server_addr()<>  '127.0.0.1' or inet_server_port()<>   as
>> through_pgpool;
>>  ip | port | through_pgpool
>> ---+--+
>>   127.0.0.1 | 5432 | t
>> (1 row)
>>
>> b1=# \q
>> guillaume@laptop:/opt/pgpool-head$ psql -h 127.0.0.1 -p 5432 b1
>> psql (9.0.2)
>> Type "help" for help.
>>
>> b1=# select inet_server_addr() as ip, inet_server_port() as port,
>> inet_server_addr()<>  '127.0.0.1' or inet_server_port()<>  5432 as
>> through_pgpool;
>>  ip | port | through_pgpool
>> ---+--+
>>   127.0.0.1 | 5432 | f
>> (1 row)
>>
>>
>> The "through_pgpool" column tells me if I'm connected using pgPool or
>> not. Actually, it won't handle every case (for example it won't if you
>> connect through an SSH tunnel).
>>
>>
> It works when the pgpool running on the same db server on the same local
> host and with different port.  It is not generic for pgpool running on
> remote server without knowing the ip and port.
> 

If you take my queries without modifying them, yes, you're right. But
you're supposed to change the IP address and the port in the query.

select inet_server_addr() <>  'your_connection_ip_number'
   or inet_server_port() <>  you_connection_port_number;


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Setting up PGpool with PostgreSQL 9.0

2011-01-20 Thread Guillaume Lelarge
Le 20/01/2011 23:58, Matthew Bennett a écrit :
> I am setting up PGpool with PostgreSQL 9.0 using streaming replication. I want
> to use PGpool to load balance between the live database and the hot-standby. 
> The
> two Postgres servers are running on their own machines and PGpool is running 
> on
> it's own server. I think I have everything set up correctly.
> 
> On the PGpool machine, I try to run: psql -p  
> 
> I get the following error:
> 
> psql: could not connect to server: No such file or directory
> Is the server running locally and accepting
> connections on Unix domain socket "/tmp/.s.PGSQL."?
> 
> I can run all of the pcp commands except for pcp_systemdb_info where I get the
> EOFError.
> 
> There must be something simple that I have missed.
> 

Can you show us your pgpool.conf file?


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] replication/failover feature in Master/Slave mode

2011-01-27 Thread Guillaume Lelarge
Le 27/01/2011 09:49, Sandeep Thakkar a écrit :
> I was just testing the pgpool with one primary and one standby on the same 
> box. 
> Hot Standby, Streaming replication, load balancing, all are working fine. 
> But, I 
> see that failover is not happening when I shut down my primary server. When I 
> manually touch the trigger file, failover happens. I thought, pgpool will 
> execute the fail over command on it's own. Am I doing anything wrong?
> 
> Here is my related settings in pgpool.conf:
> failover_command = 'touch 
> 

If you only do a touch, it means pgpool is launched on the slave? if you
want the touch happen in another node, you need to execute it via an ssh
command.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] replication/failover feature in Master/Slave mode

2011-01-27 Thread Guillaume Lelarge
Le 27/01/2011 13:06, Sandeep Thakkar a écrit :
> Here, both the dbservers and pgpool run on the single box. This may not be 
> the 
> practical scenario, but I was just testing the features.
> Hence, I directly used touch. Is it fine then?
> 

If the user has the right to create such a file, yes. Is the file
created? do you see that your failover command is executed? is there
errors in your log file?


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] stuck with a shmem_exit after the loading of "/usr/local/etc/pool_hba.conf"

2011-02-03 Thread Guillaume Lelarge
Le 03/02/2011 10:02, Bharath Keshav a écrit :
> I am getting the following error when I try to run Pgpool. I am trying to
> use postgresql 9.0 hot streaming and then load balancing capability of
> Pgpool. However, I am stuck with a shmem_exit after the loading
> of "/usr/local/etc/pool_hba.conf", as attached below. Please let me know
> what could be wrong.
> 
> 
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: listen_addresses
> 2011-02-03 08:53:20 DEBUG: pid 12138: value: '*' kind: 4
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: port
> 2011-02-03 08:53:20 DEBUG: pid 12138: value:  kind: 2
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: pcp_port
> 2011-02-03 08:53:20 DEBUG: pid 12138: value: 9898 kind: 2
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: socket_dir
> 2011-02-03 08:53:20 DEBUG: pid 12138: value: '/var/run/postgresql' kind: 4
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: pcp_socket_dir
> 2011-02-03 08:53:20 DEBUG: pid 12138: value: '/tmp' kind: 4
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: backend_socket_dir
> 2011-02-03 08:53:20 DEBUG: pid 12138: value: '/var/run/postgresql' kind: 4
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: pcp_timeout
> 2011-02-03 08:53:20 DEBUG: pid 12138: value: 10 kind: 2
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: num_init_children
> 2011-02-03 08:53:20 DEBUG: pid 12138: value: 32 kind: 2
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: max_pool
> 2011-02-03 08:53:20 DEBUG: pid 12138: value: 4 kind: 2
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: child_life_time
> 2011-02-03 08:53:20 DEBUG: pid 12138: value: 0 kind: 2
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: connection_life_time
> 2011-02-03 08:53:20 DEBUG: pid 12138: value: 0 kind: 2
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: child_max_connections
> 2011-02-03 08:53:20 DEBUG: pid 12138: value: 0 kind: 2
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: client_idle_limit
> 2011-02-03 08:53:20 DEBUG: pid 12138: value: 0 kind: 2
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: authentication_timeout
> 2011-02-03 08:53:20 DEBUG: pid 12138: value: 60 kind: 2
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: logdir
> 2011-02-03 08:53:20 DEBUG: pid 12138: value: '/var/log/pgpool' kind: 4
> 2011-02-03 08:53:20 DEBUG: pid 12138: key: pid_file_name
> 2011-02-03 08:53:20 DEBUG: pid 12138: value: '/var/run/pgpool/pgpool.pid'
> kind: 4

The usual issue you could have is that your process can't write its pid
file or its socket file. Are you sure that the user who launches pgpool
has right to write into /var/run/pgpool? (pid_file_name parameter) if
not, try to change this with another directory.

The backend socket is created in /var/run/postgresql. Does the user have
the right to write in it?


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] problem with healthcheck

2011-02-03 Thread Guillaume Lelarge
Le 03/02/2011 16:52, Michal Slocinski a écrit :
> Hi!
> 
> I'm pgpool newbie trying to setup cluster of two PostgreSQL servers.
> 
> I configureed pgpool.conf as follows:
> 
> # $Header: /cvsroot/pgpool/pgpool-II/pgpool.conf.sample-replication,v
> 1.11 2010/09/01 04:58:47 kitagawa Exp $
> listen_addresses = '*'
> port = 
> pcp_port = 9898
> socket_dir = '/tmp'
> pcp_socket_dir = '/tmp'
> backend_socket_dir = '/tmp'
> pcp_timeout = 10
> num_init_children = 32
> max_pool = 4
> child_life_time = 300
> connection_life_time = 0
> child_max_connections = 0
> client_idle_limit = 0
> authentication_timeout = 60
> logdir = '/tmp'
> pid_file_name = '/var/run/pgpool/pgpool.pid'
> replication_mode = true
> load_balance_mode = false
> replication_stop_on_mismatch = false
> failover_if_affected_tuples_mismatch = false
> replicate_select = false
> reset_query_list = 'ABORT; DISCARD ALL'
> white_function_list = ''
> black_function_list = 'nextval,setval'
> print_timestamp = true
> master_slave_mode = false
> master_slave_sub_mode = 'slony'
> delay_threshold = 0
> log_standby_delay = 'none'
> connection_cache = true
> health_check_timeout = 20
> health_check_period = 1
> health_check_user = 'nobody'
> failover_command = ''
> failback_command = ''
> fail_over_on_backend_error = true
> insert_lock = true
> ignore_leading_white_space = true
> log_statement = false
> log_per_node_statement = false
> log_connections = false
> log_hostname = false
> parallel_mode = false
> enable_query_cache = false
> pgpool2_hostname = ''
> backend_hostname0 = '172.16.2.72'
> backend_port0 = 5432
> backend_weight0 = 1
> backend_data_directory0 = '/var/lib/pgsql/data'
> backend_hostname1 = '172.16.2.73'
> backend_port1 = 5432
> backend_weight1 = 1
> backend_data_directory1 = '/var/lib/pgsql/data'
> enable_pool_hba = true
> recovery_user = 'nobody'
> recovery_password = ''
> recovery_1st_stage_command = ''
> recovery_2nd_stage_command = ''
> recovery_timeout = 90
> client_idle_limit_in_recovery = 0
> lobj_lock_table = ''
> ssl = false
> debug_level = 1
> 
> 
> Problem I have is that pgpool seems to have problem with checking
> status of PostgreSQL instances.
> 
> For example, I start both PostgreSQL servers and start pgpool, pgpool
> sees both of them as active and I can connect to pgpool and execute
> query - everything fine.
> 
> 2011-02-03 16:50:56 DEBUG: pid 22649: starting health checking
> 2011-02-03 16:50:56 DEBUG: pid 22649: health_check: 0 th DB node status: 1
> 2011-02-03 16:50:56 DEBUG: pid 22649: health_check: 1 th DB node status: 1
> 
> Now, I shutdown one of servers and pgpool correctly discovers that one
> of them is down.
> 
> 2011-02-03 16:50:56 DEBUG: pid 22649: starting health checking
> 2011-02-03 16:50:56 DEBUG: pid 22649: health_check: 0 th DB node status: 1
> 2011-02-03 16:50:56 DEBUG: pid 22649: health_check: 1 th DB node status: 3
> 
> However, when I bring it up again, pgpool seems to not be able to
> detect that node is back
> 
> 2011-02-03 16:50:56 DEBUG: pid 22649: starting health checking
> 2011-02-03 16:50:56 DEBUG: pid 22649: health_check: 0 th DB node status: 1
> 2011-02-03 16:50:56 DEBUG: pid 22649: health_check: 1 th DB node status: 3
> 

You are in replication mode. So, if you stopped node 1, node 0 continues
to work, but the node 1 is stopped and cannot be kept current. So, when
you start again the node 1, it can't be use on replication because there
could be a mismatch of data between them.

So, before restarting node 1, you need to rebuild it with node 0 datas.
I'm not much more familiar with the actions involved, but I'm sure it's
normal for node 1 to not get reattached automatically.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] White and blacklist of function

2011-02-07 Thread Guillaume Lelarge
Le 07/02/2011 09:35, Wouter D'Haeseleer a écrit :
> Hi All,
> 
> Just an enhancement question.
> I have noticed that you need to keep a list of blacklisted functions in case 
> one of the functions does a write to the db.
> 
> Maybe it's a good idea to tackle this in an automated way.
> Since if you do this kind of query on the standby server you will get a good 
> error from postgres saying it is not possible to do update querys on the 
> standby.
> If this error is tackled in pgpool and send to the primary then pgool could 
> maintain a list of querys which will fail on the standby.
> 
> Therefore an autolearning feature would be welcome I think.
> 

This won't be easy to do. Let's say you have this query :

SELECT function_which_writes(), function_which_doesnt_write;

It fails with an error indicating that one tried to write, which
function is the culprit? pgpool-II can't guess that.

Moreover, it would deny the capacity to load balance explicit transactions.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] need help on the pgpool architecture

2011-02-08 Thread Guillaume Lelarge
Le 08/02/2011 13:26, Micka a écrit :
> I would like to know if it is preferable to use postgreSQL 9 or Postgresql
> 8.3.8 ?
> 
> Postgresql 8.3.8 is described in the tutorial.
> 

9.0. Why use a two years old release...


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pcp authentification doesn't work

2011-02-21 Thread Guillaume Lelarge
Le 21/02/2011 18:36, Micka a écrit :
> Hi,
> 
> I'm trying to understand on how to use the pcp command, but it doesn't work
>  see :
> 
> mickael@PTI2:/var/log/pgpool$ pcp_node_count 10 localhost 9898 postgres
> pgpoolAdmin
> AuthorizationError
> 
> And
>  sudo nano /usr/local/etc/pcp.conf
> 
> 
> # USERID:MD5PASSWD
> postgres:e8a48653851e28c69d0506508fb27fc5
> postgres1:6b9883ad2fdc7256b95cfafbbe8e455b
> micka:a97e914ee3a3a8592a0fecd2d77e0c04
> 
> I don't know why i've got AuthorizationError.
> 

pgpoolAdmin is the password of "postgres1" user, not postgres. You
should launch:

pcp_node_count 10 localhost 9898 postgres1 pgpoolAdmin


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Problems configuring pgpool-II 3.0 to failover gracefully and load balance queries

2011-02-21 Thread Guillaume Lelarge
Le 21/02/2011 19:59, Stephen Sugden a écrit :
> Hello everybody,
> 
> I am trying to configure pgpool-II to load balance queries and provide
> failover for 2 (or more) identical backend servers. The application that
> will access pgpool only does SELECT queries. The back end servers are
> written to directly by a custom ETL process (e.g. no slony or pg9
> replication).
> 
> In my tests I have observed the following behaviour:
> 
> - Load Balancing appears to load balance incoming connections, not queries.
> If I open a single connection and execute a series of select queries, they
> all get routed to the same backend. If I open up multiple connections, both
> backends are used.

Which is what we call session pooling. I don't see an issue here.

> - When a node shuts down the pool drops *all* connections. (but subsequent
> connections are correctly only sent to the backend that is still up)
> - re-adding a node to the pool using pcp_attach_node causes the pool to
> reset and all current connections will be closed
> 
> Is this expected behaviour?

Not for the two last ones. Probably Tatsuo could explain that.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pcp authentification doesn't work

2011-02-22 Thread Guillaume Lelarge
Le 22/02/2011 09:52, Micka a écrit :
> by the way :
> 
> -rwxr-xr-x 1 www-data root  722 2010-11-12 06:45 failover.sh
> -rw-r--r-- 1 www-data root  982 2011-02-21 18:31 pcp.conf
> -rw-r--r-- 1 root root  858 2011-02-22 09:08 pcp.conf.sample
> -rw-r--r-- 1 www-data root 9532 2011-02-22 04:59 pgpool.conf
> -rw-r--r-- 1 root root 9741 2011-02-22 09:08 pgpool.conf.sample
> -rw-r--r-- 1 root root 9767 2011-02-22 09:08
> pgpool.conf.sample-master-slave
> -rw-r--r-- 1 root root 9764 2011-02-22 09:08
> pgpool.conf.sample-replication
> -rw-r--r-- 1 root root 9795 2011-02-22 09:08 pgpool.conf.sample-stream
> -rw-r--r-- 1 root root 9542 2011-02-21 23:23 pgpool.conf.save
> -rw-r--r-- 1 root root 3337 2011-02-22 09:08 pool_hba.conf.sample
> 
> 
> normally the pcp programme can access to the file pcp.conf , right ? It
> shouldn't be the problem
> 

Depends if you told pgpool where to find it. How did you launch pgPool?

Oh, and stop top-posting, it makes it hard to answer to you.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pcp authentification doesn't work

2011-02-22 Thread Guillaume Lelarge
Le 22/02/2011 10:58, Micka a écrit :
> Thanks,
> 
> " Depends if you told pgpool where to find it. How did you launch pgPool? "
> 
> pgPool is not launching yet.
> 
> Because i'm following this tutorial :
> 
> http://pgpool.projects.postgresql.org/contrib_docs/simple_sr_setting/index.html
> 
> I should have this screen :
> 
> http://pgpool.projects.postgresql.org/contrib_docs/simple_sr_setting/operation_images/01.png
> 
> 
> but i've got in the pgpool status :
> 
> Error Code e1002  Error Message pcp_node_count command error occurred.
> 
> Instead of "stop pgpool" as referenced in the picture.
> 

And what do you have in this screen instead of /usr/local/etc/pcp.conf?


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] [pgPool]

2011-02-23 Thread Guillaume Lelarge
Le 23/02/2011 22:58, Micka a écrit :
> I tried to test the pcp command myself :
> 
> mickael@PTI2:/usr/local/bin$ psql -U postgres
> psql (9.0.3)
> Type "help" for help.
> 
> postgres=# ALTER USER postgres WITH PASSWORD 'toto';
> ALTER ROLE
> postgres=# \q
> mickael@PTI2:/usr/local/bin$ pcp_recovery_node -d 10 localhost 9898 postgres
> toto 1
> DEBUG: send: tos="R", len=46
> DEBUG: recv: tos="r", len=63, data=AuthenticationFailed
> DEBUG: authentication failed. reason=AuthenticationFailed
> AuthorizationError
> 
> But nothing more, I don't understand why I got the AuthorizationError.
> 

PCP authorization has nothing to do with PostgreSQL users and passwords.
You set user and password in pcp.conf (user in clear text, password in
md5). You need to use pg_md5 to hash the password.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] [pgPool]

2011-02-24 Thread Guillaume Lelarge
Le 24/02/2011 18:17, Micka a écrit :
> Yes it was, Thx !
> 
> Now the replication functionnality work well !
> 
> but when the main database server goes down I got :
> 
> 2011-02-24 18:06:42 DEBUG: pid 1313: starting health checking
> 2011-02-24 18:06:42 DEBUG: pid 1313: health_check: 0 th DB node status: 2
> 2011-02-24 18:06:42 DEBUG: pid 1313: health_check: 1 th DB node status: 2
> 2011-02-24 18:06:44 DEBUG: pid 1347: do_query: kind: T
> 2011-02-24 18:06:44 DEBUG: pid 1347: num_fileds: 1
> 2011-02-24 18:06:44 DEBUG: pid 1347: do_query: kind: D
> 2011-02-24 18:06:44 DEBUG: pid 1347: do_query: kind: C
> 2011-02-24 18:06:44 DEBUG: pid 1347: do_query: kind: Z
> 2011-02-24 18:06:44 DEBUG: pid 1347: do_query: kind: T
> 2011-02-24 18:06:44 DEBUG: pid 1347: num_fileds: 1
> 2011-02-24 18:06:44 DEBUG: pid 1347: do_query: kind: D
> 2011-02-24 18:06:44 DEBUG: pid 1347: do_query: kind: C
> 2011-02-24 18:06:44 DEBUG: pid 1347: do_query: kind: Z
> 2011-02-24 18:06:52 DEBUG: pid 1313: starting health checking
> 2011-02-24 18:06:52 DEBUG: pid 1313: health_check: 0 th DB node status: 2
> 2011-02-24 18:06:52 DEBUG: pid 1313: health_check: 1 th DB node status: 2
> 2011-02-24 18:06:54 ERROR: pid 1347: pool_flush_it: write failed to backend
> (0). reason: Broken pipe offset: 0 wlen: 39
> 2011-02-24 18:06:54 ERROR: pid 1347: check_replication_time_lag: SELECT
> pg_current_xlog_location() failed
> 2011-02-24 18:07:02 DEBUG: pid 1313: starting health checking
> 2011-02-24 18:07:02 DEBUG: pid 1313: health_check: 0 th DB node status: 2
> 2011-02-24 18:07:02 ERROR: pid 1313: connect_unix_domain_socket_by_port:
> connect() failed: No such file or directory
> 2011-02-24 18:07:02 ERROR: pid 1313: health check failed. 0 th host  at port
> 5432 is down
> 2011-02-24 18:07:02 LOG:   pid 1313: set 0 th backend down status
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler called
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: starting to select
> new master node
> 2011-02-24 18:07:02 LOG:   pid 1313: starting degeneration. shutdown host
> (5432)
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1314
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1315
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1316
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1317
> 
> and :
> 
> 011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1334
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1335
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1336
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1337
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1338
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1339
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1340
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1341
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1342
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1343
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1344
> 2011-02-24 18:07:02 DEBUG: pid 1313: failover_handler: kill 1345
> 2011-02-24 18:07:02 LOG:   pid 1313: execute command:
> /usr/local/etc/failover.sh 0 "" 5432 /usr/local/pgsql/data 1 0 "" 0
> 2011-02-24 18:07:02 DEBUG: pid 1314: child received shutdown request signal
> 3
> 2011-02-24 18:07:02 DEBUG: pid 1315: child received shutdown request signal
> 3
> 2011-02-24 18:07:02 DEBUG: pid 1316: child received shutdown request signal
> 3
> *touch: cannot touch `/var/log/pgpool/trigger/trigger_file1': Permission
> denied*
> 2011-02-24 18:07:02 LOG:   pid 1313: failover_handler: set new master node:
> 1
> 2011-02-24 18:07:02 DEBUG: pid 1317: child received shutdown request signal
> 3
> 2011-02-24 18:07:02 DEBUG: pid 1318: child received shutdown request signal
> 3
> 2011-02-24 18:07:02 DEBUG: pid 1319: child received shutdown request signal
> 3
> 2011-02-24 18:07:02 DEBUG: pid 1320: child received shutdown request signal
> 3
> 2011-02-24 18:07:02 DEBUG: pid 12178: I am 12178
> 2011-02-24 18:07:02 DEBUG: pid 12179: I am 12179
> 2011-02-24 18:07:02 DEBUG: pid 12180: I am 12180
> 2011-02-24 18:07:02 DEBUG: pid 12177: I am 12177
> 2011-02-24 18:07:02 DEBUG: pid 12181: I am 12181
> 2011-02-24 18:07:02 DEBUG: pid 1322: child received shutdown request signal
> 3
> 2011-02-24 18:07:02 DEBUG: pid 12176: I am 12176
> 
> 011-02-24 18:07:02 DEBUG: pid 12205: I am 12205
> 2011-02-24 18:07:02 DEBUG: pid 1338: child received shutdown request signal
> 3
> 2011-02-24 18:07:02 DEBUG: pid 12206: I am 12206
> 2011-02-24 18:07:02 LOG:   pid 1313: failover done. shutdown host (5432)
> 2011-02-24 18:07:02 DEBUG: pid 1339: child received shutdown request signal
> 3
> 2011-02-24 18:07:02 DEBUG: pid 1313: pool_ssl: SSL requested but SSL support
> is not available
> 2011-02-24 18:07:02 DEBUG: pid 1340: child received shutdown request signal
> 3
> 2011-02-24 18:07:02 DEBUG: pid 1341: child received shutdown request sig

Re: [Pgpool-general] Changing the default location of configuration files while building pgpool-II

2011-03-15 Thread Guillaume Lelarge
Le 15/03/2011 14:08, Sandeep Thakkar a écrit :
> I think, the default path should be the relative path from where the binary 
> exists. So, it should be "../etc/pgpool.conf". Can we do it? We use pgpool-II 
> 3.0.3 sources.
> 

Why don't you use the -f option to specify your configuration file location?


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Is pgpool-II v.2.0.1 compatible with PostgreSQL v9.0.3?

2011-03-17 Thread Guillaume Lelarge
Le 17/03/2011 11:53, Gnanakumar a écrit :
> Hi,
> 
> Our production server is running PostgreSQL v8.2.3 and pgpool-II-v2.0.1.
> 
> We're planning to upgrade PostgreSQL to the latest version 9.0.3.  My
> question is, is it possible/compatible to run pgpool-II v.2.0.1 with
> PostgreSQL v9.0.3?
> 

Don't know honestly, but I wonder why you would use such a old release
of pgpool with the latest release of PostgreSQL.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] lag threshold in slony

2011-03-20 Thread Guillaume Lelarge
Le 20/03/2011 10:44, Tatsuo Ishii a écrit :
>> I'm new to pgpool and to this list. I'm trying to set up a load
>> balancing cluster using pgpool-II 3.0 and slony. So far it seems to
>> work as expected, except for one key aspect: it seems as it is not
>> implemeted the lag check for slony, only for streaming replication.
>> I'm looking at pool_worker_child.c and it seems that the only mode
>> that does any check is streaming replication.
>> Are there any plans on implementing this feature?
>> There is another way to solve this (i.e. hooking an external command
>> to the health check)?
>>
>> Thanks in advance!
> 
> Currently there's no plan to implement the lag checking for Slony-I. I
> don't know it is possible for pgpool-II to extract lag info from
> Slony-I or not.

There is a specific view (sl_status) which allows you to check the lag
of one replication set. It shouldn't be too hard to do if you restrict
this config to one replication set (which is more or less what you need
to have if you're using the load balancing feature of pgpool with the
slony replication system).


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] hash index - does not work from slave.

2011-03-22 Thread Guillaume Lelarge
Le 22/03/2011 15:25, Armin Nesiren a écrit :
> I have problem reading from slave node values that is indexed with hash
> index.
> 
> Does pgpool replicate hash indexes? Is there any special configuration for
> hash index?
> 

If you use pgpool replication system, you should have no issue with hash
index (or any other kind of index).

The only replication system that has issue with hash index, AFAIK, is
the wal shipping of PostgreSQL.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] hash index - does not work from slave.

2011-03-22 Thread Guillaume Lelarge
Le 22/03/2011 16:59, Armin Nesiren a écrit :
> But, what am I doing wrong then.
> When I insert something in master node, and after that take select, I see my
> record.
> 
> On slave, when using index I can not see exact record, and without using
> index, record is there.
> I have configured streaming replication.
> 

Streaming replication doesn't replicate hash index changes because they
aren't logged in the WALs.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgpool running on only one box?

2011-03-30 Thread Guillaume Lelarge
Le 31/03/2011 02:03, Sean Tegtmeyer a écrit :
> Hi all,
>In both master-slave mode and replication mode, pgpool-II is only running
> on one box, correct?

If you only run pgpool on one box, yes, correct.

>  Therefore pgpool-II does not provide
> a fail-over solution in the case that the box running pgpool-II goes down,
> and it would be up to the user of pgpool-II to implement
> a fail-over solution that would start pgpool-II on another box, correct?

Yes, correct too.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgpool running on only one box?

2011-03-31 Thread Guillaume Lelarge
Le 31/03/2011 09:40, Micka a écrit :
> My idea was, and I didn't test it, it's:
> 
> Server 1Server 2
> postgres 9 A  postgres9 B
> pgpool A   pgpool B
> application A application B
> 
> The idea was :
> 
> - pgpool A is active, it's doing a streaming replication with postgres A and
> B.

pgPool-II doesn't do streaming replication. PostgreSQL does.

> -application A is communicating with pgpool A.
> - application B is communicating with pgpool A.
> 
> if the server 1 goes down, pgpool is starting, doing the failover command.
> The application B detect that pgpoolA is not working anymore, and try to
> communicate with pgpoolB.
> 

Should work.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Adding new slave node, need to restart pgpool-II?

2011-04-02 Thread Guillaume Lelarge
Le 01/04/2011 03:45, Sean Tegtmeyer a écrit :
> Hi all,
> When adding in a new slave node to a running database cluster using
> pgpool-II w/Postgres9.0 SR, we would need to add a new *"**backend_hostname"
> *to the pgpool.conf, correct?  Then would it be necessary to restart
> pgpool-II as the pgpool-II manual suggests?  I ask because I thought I read
> somewhere else that it was not always necessary to restart pgpool-II when
> changes were made to the pgpool.conf config file.
> 

It's quite the same than PostgreSQL. Some changes don't require to
restart pgpool, and some require a restart. Unfortunately in your case,
adding a new backend needs a restart. Changing informations on one
backend doesn't require a restart.

> Is it also true that there is no other way to tell pgpool-II about a new
> node except via it's config file (some other way to avoid having to restart
> pgpool-II)?
> 

True.

> Also I read in the manual with regards to online recovery in master-slave
> mode with streaming replication that "To recover the primary node, you have
> to stop all DB nodes and pgpool-II, and then restore it from a backup."  Is
> this still true?
> 

What do you mean with "recover the primary node"?


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Using pgpool-II with PostgreSQL 8.3 and 9.0 at the same time

2011-04-02 Thread Guillaume Lelarge
Le 01/04/2011 08:06, Karl Lehenbauer a écrit :
> Hi,
> 
> We have slony replication running with a 4 node cluster and we have been 
> using pgpool-II for a long time, to load balance certain queries.  
> 
> Now we are preparing to migrate to PostgreSQL 9.0.  Currently, one of our 
> slony slaves is running 9.0 and all the other nodes (master and slaves) are 
> running 8.3.
> 
> We would like to use pgpool to connect to the 8.3 and 9.0 servers at the same 
> time -- our systems are pretty busy and we would like to stay up with three 
> nodes as we migrate them one-by-one to 9.0.
> 
> When we try to connect pgpool-II to 8.3 and 9.0 Postgres versions at the same 
> time, the connection startup code gets out of sync... pool_do_auth calls 
> ParameterStatus, and ParameterStatus gets out of sync because the 9.0 server 
> sends "application_name" and the 8.3 servers do not.  (I saw a recent commit 
> to support application_name but I realize it was not designed to address this 
> issue.)
> 
> So my question is... is it possible to run pgpool-II with 8.3 and 9.0 at the 
> same time, or should we just work out a way to switch pgpool all at once from 
> 8.3 to 9.0?
> 

I didn't try myself, but I guess it should work if you have the latest
8.3 (latest release of each branch accepts this new connection
parameter... they do nothing with it obviously, but they accept the
connection).


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Trouble with pgpool installation

2011-06-10 Thread Guillaume Lelarge
On Fri, 2011-06-10 at 12:52 -0400, Paul Giblock wrote:
> Any help with this?
> 

Before putting pgpool in the middle of this, did you install master and
slave as recommended on
http://www.postgresql.org/docs/9.0/interactive/warm-standby.html ?


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] PgPool logging

2011-07-05 Thread Guillaume Lelarge
On Tue, 2011-07-05 at 10:53 +0200, Mario Splivalo wrote:
> I have set up logdir in pgpool.conf, but no logging ever takes place 
> there. It seem that the only way pgpool is logging stuff is to stdout 
> (where I can redirect it to file, pipe it to logger process, etc).
> I even set debug to 1 in .conf file, no gain.
> 
> Am I missing something here?
> 

Yes, logdir doesn't allow you to set up the logging directory, but the
directory that will hold the pgpool_status file.

You don't have much possibility on pgpool 3.0 regarding the log. Either
you send them to syslog, or you send them to stderr.

3.1 will be better for this.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] PgPool logging

2011-07-05 Thread Guillaume Lelarge
On Tue, 2011-07-05 at 16:18 +0200, Mario Splivalo wrote:
> On 07/05/2011 01:51 PM, Guillaume Lelarge wrote:
> > On Tue, 2011-07-05 at 10:53 +0200, Mario Splivalo wrote:
> >> I have set up logdir in pgpool.conf, but no logging ever takes place
> >> there. It seem that the only way pgpool is logging stuff is to stdout
> >> (where I can redirect it to file, pipe it to logger process, etc).
> >> I even set debug to 1 in .conf file, no gain.
> >>
> >> Am I missing something here?
> >>
> >
> > Yes, logdir doesn't allow you to set up the logging directory, but the
> > directory that will hold the pgpool_status file.
> 
> And, I presume that queries, if set up that way, will be logged there.

Not, only the status of the backends.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] We really need a change to the API for calling recovery

2011-07-21 Thread Guillaume Lelarge
On Thu, 2011-07-21 at 13:27 +0900, Tatsuo Ishii wrote:
> > Tatsuo,
> > 
> > Currently the recovery routine is called on the current master database,
> > and the parameters passed to it do not include the master database IP
> > address or hostname.  Given that the way to provision a node with 9.1
> > replication is via pg_basebackup, which MUST be run on the standby, this
> > makes writing a recovery script which actually works rather difficult
> > and unreliable.
> > 
> > I really think that you need to look at restructuring how the recovery
> > call for new nodes works.  What I would prefer is to have a script which
> > is called *on the pgpool server* itself, and not on the master node.
> > This script would be passed the master address and the standby address;
> > I don't think it would need any other parameters.
> 
> Maybe that is only true for streaming replication. I would think about
> how to deal with pg_basebackup. BTW, I think the script would need
> user, password and port number at least.
> 
> > If that's impossible for some reason, can we at least pass the master
> > address to the recovery script?  Working without it is unnecessarily
> > difficult.
> 
> That would be easy. I would do it for 3.1.

I thought the idea was to work on 9.1 for 3.2. Anyway, if we keep adding
things to 3.1, it will never be released.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] We really need a change to the API for calling recovery

2011-07-21 Thread Guillaume Lelarge
On Thu, 2011-07-21 at 16:29 +0900, Tatsuo Ishii wrote:
> > On Thu, 2011-07-21 at 13:27 +0900, Tatsuo Ishii wrote:
> >> > Tatsuo,
> >> > 
> >> > Currently the recovery routine is called on the current master database,
> >> > and the parameters passed to it do not include the master database IP
> >> > address or hostname.  Given that the way to provision a node with 9.1
> >> > replication is via pg_basebackup, which MUST be run on the standby, this
> >> > makes writing a recovery script which actually works rather difficult
> >> > and unreliable.
> >> > 
> >> > I really think that you need to look at restructuring how the recovery
> >> > call for new nodes works.  What I would prefer is to have a script which
> >> > is called *on the pgpool server* itself, and not on the master node.
> >> > This script would be passed the master address and the standby address;
> >> > I don't think it would need any other parameters.
> >> 
> >> Maybe that is only true for streaming replication. I would think about
> >> how to deal with pg_basebackup. BTW, I think the script would need
> >> user, password and port number at least.
> >> 
> >> > If that's impossible for some reason, can we at least pass the master
> >> > address to the recovery script?  Working without it is unnecessarily
> >> > difficult.
> >> 
> >> That would be easy. I would do it for 3.1.
> > 
> > I thought the idea was to work on 9.1 for 3.2. Anyway, if we keep adding
> > things to 3.1, it will never be released.
> 
> I've been waiting for French, Germany translations are coming. I hoped
> these are included in 3.1.

On the french one, Jean-Paul is currently on holidays. He'll come back
next week. Anyways, I know he had made progress in the translation, but,
unless he worked on it during his holidays, it'll surely take more time
to have a full translation. And when I say more time, I mean a few
months.

And AFAICT, last mail from Markus was sent in March. He said he had done
25% of the translatio, and expected to finish in April. No news since.

So, I wouldn't wait for any of those translations to complete 3.1. And
translations may be added later.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Confused about JDBC and load balancing

2011-07-21 Thread Guillaume Lelarge
On Thu, 2011-07-21 at 10:41 +0200, David Hartveld wrote:
> Op 21-07-11 08:16, Toshihiro Kitagawa schreef:
> > On Wed, 20 Jul 2011 11:58:45 -0400
> > Matt Solnit  wrote:
> >
> >> Hi everyone.  I'm trying to understand why load balancing doesn't work 
> >> with the PostgreSQL JDBC driver, and what (if anything) can be done about 
> >> it.  I have to admit, I find the documentation a bit confusing.  Here is 
> >> what it currently says at 
> >> http://pgpool.projects.postgresql.org/pgpool-II/doc/pgpool-en.html:
> >>
> >>  "Note: the JDBC driver has an autocommit option. If autocommit is 
> >> false, the JDBC driver sends "BEGIN" and "COMMIT" by itself. So pgpool 
> >> cannot do any load balancing. You need to call setAutoCommit(true) to 
> >> enable autocommit."
> >
> > I think we have to revise the manual more clearly...
> >
> > It's a description about load balancing in replication mode.
> > In the case of Master/Slave mode, please watch "Streaming Replication"
> > section:
> >
> > In an explicit transaction:
> >
> > - Transaction starting commands such as BEGIN are sent to the primary
> >node.
> > - Following SELECT and some other queries that can be sent to both
> >primary or standby are executed in the transaction or on the standby
> >node.
> > - Commands which cannot be executed on the standby such as INSERT are
> >sent to the primary. After one of these commands, even SELECTs are
> >sent to the primary node, This is because these SELECTs might want
> >to see the result of an INSERT immediately. This behavior continues
> >until the transaction closes or aborts.
> >
> >> And yet, a recent post to this mailing list 
> >> (http://pgfoundry.org/pipermail/pgpool-general/2011-July/003819.html) 
> >> contradicts this, and says that recent versions of pgpool-II can handle 
> >> explicit transactions.  And the flow chart 
> >> (http://pgpool.projects.postgresql.org/pgpool-II/doc/where_to_send_queries.pdf)
> >>  seems to say the same thing.
> >>
> >> Even more confusing is the fact that it *does* seem to work once in a 
> >> while.  I'm currently using pgpool-II 3.0.4, with PostgreSQL 9.0.2 in 
> >> streaming replication mode, and JDBC driver.  When I enable statement 
> >> logging in both pgpool-II and PostgreSQL, I can see that a very small 
> >> number queries do go to the slave.  I have not been able to figure out any 
> >> pattern to this.
> >>
> >> I would really love to understand more about what is going on.  Any help 
> >> would be sincerely appreciated.
> >
> > I guess that the last condition mentioned above is related.
> >
> > For example:
> >
> >BEGIN
> >SELECT ->  load balancing
> >INSERT etc.(write-query)
> >SELECT ->  not load balancing
> >SELECT ->  not load balancing
> >COMMIT
> 
> I was wondering what will happen in the following scenario, when 
> streaming replication is replayed between SELECT 2 and 3 on the slave, 
> altering the 'snapshot' view of the database from the users point of 
> view - this will possibly return inconsistent data, right?
> 
> 1  BEGIN
> 2  SELECT -> Load-balance
>Replay xlog on slave where next SELECT is executed
> 3  SELECT -> Load-balance
> 4  COMMIT

Yes, that's a possible issue. While having the possibility to load
balance an explicit transaction is interesting, it should be possible to
disable this behaviour. We would like to add a parameter that would
allow this. But for 3.2 obviously.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] We really need a change to the API for calling recovery

2011-07-21 Thread Guillaume Lelarge
On Thu, 2011-07-21 at 18:02 +0900, Tatsuo Ishii wrote:
> From: Guillaume Lelarge 
> Subject: Re: [Pgpool-general] We really need a change to the API for calling 
> recovery
> Date: Thu, 21 Jul 2011 10:07:46 +0200
> Message-ID: <1311235666.2018.11.camel@laptop>
> 
> > On Thu, 2011-07-21 at 16:29 +0900, Tatsuo Ishii wrote:
> >> > On Thu, 2011-07-21 at 13:27 +0900, Tatsuo Ishii wrote:
> >> >> > Tatsuo,
> >> >> > 
> >> >> > Currently the recovery routine is called on the current master 
> >> >> > database,
> >> >> > and the parameters passed to it do not include the master database IP
> >> >> > address or hostname.  Given that the way to provision a node with 9.1
> >> >> > replication is via pg_basebackup, which MUST be run on the standby, 
> >> >> > this
> >> >> > makes writing a recovery script which actually works rather difficult
> >> >> > and unreliable.
> >> >> > 
> >> >> > I really think that you need to look at restructuring how the recovery
> >> >> > call for new nodes works.  What I would prefer is to have a script 
> >> >> > which
> >> >> > is called *on the pgpool server* itself, and not on the master node.
> >> >> > This script would be passed the master address and the standby 
> >> >> > address;
> >> >> > I don't think it would need any other parameters.
> >> >> 
> >> >> Maybe that is only true for streaming replication. I would think about
> >> >> how to deal with pg_basebackup. BTW, I think the script would need
> >> >> user, password and port number at least.
> >> >> 
> >> >> > If that's impossible for some reason, can we at least pass the master
> >> >> > address to the recovery script?  Working without it is unnecessarily
> >> >> > difficult.
> >> >> 
> >> >> That would be easy. I would do it for 3.1.
> >> > 
> >> > I thought the idea was to work on 9.1 for 3.2. Anyway, if we keep adding
> >> > things to 3.1, it will never be released.
> >> 
> >> I've been waiting for French, Germany translations are coming. I hoped
> >> these are included in 3.1.
> > 
> > On the french one, Jean-Paul is currently on holidays. He'll come back
> > next week. Anyways, I know he had made progress in the translation, but,
> > unless he worked on it during his holidays, it'll surely take more time
> > to have a full translation. And when I say more time, I mean a few
> > months.
> > 
> > And AFAICT, last mail from Markus was sent in March. He said he had done
> > 25% of the translatio, and expected to finish in April. No news since.
> > 
> > So, I wouldn't wait for any of those translations to complete 3.1. And
> > translations may be added later.
> 
> Ok. For localized documentations, we will wait till beta. If those
> translations are not done, they will be added after 3.1.
> 
> In addition to this, there are volunteers who want to translate to
> Simplified Chinese. It seems tutorial-en.html is almost translated. So
> we may be able to add to 3.1.
> 

I've seen that. They did a great (and quick) job. Really cool.

> BTW, Jehan-Guillaume said:
> 
> > I needed to refactor pcp_proc_info to add pcp_proc_info and
> > pcp_pric_count to pgpool_adm.
> >
> > But I think I'll need to refactor pcp_node_info as well if I want to
> > add pcp_node_count in the same way.
> 
> So it seems we are waiting for him to refactor pcp_node_info.

Yes. He's doing a training right now, so I guess you won't heard from
him until next week.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgpool limitations

2011-08-04 Thread Guillaume Lelarge
On Sat, 2011-07-30 at 08:38 +0900, Tatsuo Ishii wrote:
> > On Thu, Jul 28, 2011 at 10:40 PM, Tatsuo Ishii  wrote:
> > 
> >> >> Because newly added node is likely to have out of sync databases. Thus
> >> >> bringing it online immediately will allow user to use obsolete
> >> >> databases. You should do online recovery first.
> >> >>
> >> >
> >> > Since the new slave being added is configured using streaming
> >> replication,
> >> > it is lagging behind the master just as much as any other currently
> >> > configured slave. So from that standpoint the new slave should be allowed
> >> to
> >> > serve queries.
> >>
> >> It will be possible with pgpool-II 3.1 (without resetting existing
> >> connections).
> >>
> > 
> > Is there something in the works to enable this, or is this feature still in
> > design phase? If it is already being/been developed, I wish to know if this
> > can be back-patched to a point release of pgpool 3.0.x.
> 
> It has been already in pgpool-II 3.1 alpha version.
> Currently there's no plan to back-patching to 3.0.x.

I certainly hope we won't backpatch a new feature. That would be insane.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Can pgpool-II retry failed health checks?

2011-08-04 Thread Guillaume Lelarge
On Fri, 2011-08-05 at 00:17 -0400, Matt Solnit wrote:
> On Jul 29, 2011, at 10:37 PM, Matthew Solnit wrote:
> 
> > Hi everyone.  I'm using pgpool-II 3.0.4 with PostgreSQL 9.0.2, in streaming 
> > replication mode.  We've had
> > a couple of cases where pgpool-II got a network timeout while performing a 
> > health check on the master
> > node, and then immediately initiated failover and promoted the slave.  This 
> > was a problem in our case
> > because the master was actually fine -- there was just a temporary network 
> > "hiccup" that caused a timeout.
> > 
> > Is there any way to configure pgpool-II to retry in this case?  I couldn't 
> > find one in the documentation.
> > 
> > I did see the "Unplugged Wire" thead 
> > (http://pgfoundry.org/pipermail/pgpool-general/2010-March/002589.html),
> > which indicates that there was a single retry at one point, which was 
> > removed.  But what I am more interested
> > in is a configurable number of retries, with a configurable delay between 
> > retries.
> > 
> > -- Matt
> 
> Hi everyone.  I just wanted to try one more time to get an answer for this 
> :-).  We would really, really
> like to find a solution.
> 

That kind of configuration doesn't exist right, but could be interesting
to add to a future release.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] connections not pooling

2011-08-19 Thread Guillaume Lelarge
On Fri, 2011-08-19 at 11:17 -0400, Johnny Tan wrote:
> Thanks Tatsuo.
> 
> I originally started with that (num_init_children=16), but then when
> all connections were used, even though they were idle, new connections
> would hang forever.

Sure, it's normal behaviour for pgPool. The pooling is done in session
mode. It means that once a session is started, the pgpool process for
this session is blocked. It cannot handle any other request.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] connections not pooling

2011-08-19 Thread Guillaume Lelarge
On Fri, 2011-08-19 at 17:12 -0400, Johnny Tan wrote:
> >> I originally started with that (num_init_children=16), but then when
> >> all connections were used, even though they were idle, new connections
> >> would hang forever.
> >
> > Sure, it's normal behaviour for pgPool. The pooling is done in session
> > mode. It means that once a session is started, the pgpool process for
> > this session is blocked. It cannot handle any other request.
> 
> So, the only option is to more or less force a client disconnect, so
> another client can come in and reuse the same connection? In that
> case, I could set max_connections=1. Which seems odd to me, but in
> theory, should let us take advantage of pooling, right?
> 

I guess the disconnected client won't be happy about that :) pgPool is
really usefull when you have lots of small sessions. If you only have
some long connections, then pgpool pooling mode won't be of any use.
Perhaps the other modes, but not the pooling one. And in this case, you
should better look at pgBouncer and its transaction or query pooling
mode.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Replicate selected table

2011-09-22 Thread Guillaume Lelarge
On Thu, 2011-09-22 at 16:59 +0200, Micka wrote:
> Hello,
> 
> I've two server : A & B.
> 
> In the Server A, I've the table 1 and 3
> In the Server B, I've the table 2 and 4.
> 
> I would like to know if the server A can replicate the table 1 and 3 to the
> server B.
> And the server B can replicate the table 2 and 4 to the server A ?
> 

Not with pgpool replication mode. You need Slony or Londiste or Bucardo
for that.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Pgpool 3.1 errors

2011-10-04 Thread Guillaume Lelarge
On Tue, 2011-10-04 at 10:39 +0200, Olivier NOEL wrote:
> Hi,
> 
> I compiled and installed pgpool 3.1 on Debian Wheezy yesterday. No
> compile errors.
> 
> But I have a LOT of errors :
> 
> Oct  4 10:09:48 pgpool01 pgpool: 2011-10-04 10:09:48 ERROR: pid 1198:
> Child process 7712 was terminated by segmentation fault
> Oct  4 10:09:48 pgpool01 pgpool: 2011-10-04 10:09:48 ERROR: pid 1198:
> Child process 8249 was terminated by segmentation fault
> Oct  4 10:09:48 pgpool01 pgpool: 2011-10-04 10:09:48 LOG:   pid 9698:
> do_child: failback event found. restart myself.
> Oct  4 10:09:48 pgpool01 pgpool: 2011-10-04 10:09:48 LOG:   pid 9699:
> do_child: failback event found. restart myself.
> Oct  4 10:09:48 pgpool01 kernel: [30451.414053] pgpool[7712]: segfault
> at 0 ip 004495b0 sp 7fff942728c0 error 4 in
> pgpool[40+dc000]
> Oct  4 10:09:48 pgpool01 kernel: [30451.415038] pgpool[8249]: segfault
> at 0 ip 004495b0 sp 7fff942728c0 error 4 in
> pgpool[40+dc000]
> Oct  4 10:10:08 pgpool01 kernel: [30471.410705] pgpool[7880]: segfault
> at 0 ip 004495b0 sp 7fff942728c0 error 4 in
> pgpool[40+dc000]
> Oct  4 10:10:08 pgpool01 pgpool: 2011-10-04 10:10:08 ERROR: pid 1198:
> Child process 7880 was terminated by segmentation fault
> Oct  4 10:10:08 pgpool01 pgpool: 2011-10-04 10:10:08 LOG:   pid 9705:
> do_child: failback event found. restart myself.
> 
> And a LOT of :
> 
> pid 1465: ProcessFrontendResponse: failed to read kind from frontend.
> frontend abnormally exited
> 
> Pgpool 3.1 on Debian Wheezy, compiled with postgresql-server-dev-9.1
> Postgresql server 9.1 on FreeBSD 8.2 in streaming replication, 1
> master 2 slaves (replication is working)
> 
> Pgpool kept disconnecting Postgres backends randomly. It didn't find
> at first the master node, I had to rename the node from
> backend_hostname6 to backend_hostname0.
> Another weird thing is that pgpool connects to the postgres backends
> with "nobody" instead of "postgres".
> 
> I can't use pgpool 3.0.4 either (version of pegpool on Debian Wheezy),
> because I get "portal" errors :
> ERROR:  portal "" does not exist
> ERROR:  portal "pgpool_error_portal" does not exist
> 
> Config file is attached.
> 

The conf file you're using is a 3.0 one. I hope you don't use that for
3.1, as it may not work at all.

Your num_init_children seems way too big. 1000... it means pgpool will
launch 1000 subprocesses when it starts. Kinda crazy :) Moreover, with
the max_pool at 8, it means pgpool can have 8000 connections to your
PostgreSQL server. Have you really configured PostgreSQL with a
max_connections of 8000?

On the load balancing configuration, you didn't deny load balancing of
nextval and setval, which is obviously an error.

On your backend configuration, you set backend_hostname0, and then go
directly to backend_hostname7. It may be an issue. Try to set them in
order (O, then 1, then 2). Not sure it has a real value, I never tried
that, but it works for me when they are set in order, and without hole.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Pgpool 3.1 errors

2011-10-04 Thread Guillaume Lelarge
On Tue, 2011-10-04 at 14:36 +0200, Olivier NOEL wrote:
> 2011/10/4 Olivier NOEL :
> > 2011/10/4 Olivier NOEL :
> >
> >>> The conf file you're using is a 3.0 one. I hope you don't use that for
> >>> 3.1, as it may not work at all.
> >>
> >> The conf file is essentially the same, no real differences, with the
> >> exception of backend_socket_dir, which is deprecated
> >>
> >>> Your num_init_children seems way too big. 1000... it means pgpool will
> >>> launch 1000 subprocesses when it starts. Kinda crazy :) Moreover, with
> >>> the max_pool at 8, it means pgpool can have 8000 connections to your
> >>> PostgreSQL server. Have you really configured PostgreSQL with a
> >>> max_connections of 8000?
> >>
> >> Each Postgresql have a max_connections of 1000 (we have above 600
> >> connections per , we planned to have 8 servers. Actually max_pool is
> >> at 3
> >>
> >>> On the load balancing configuration, you didn't deny load balancing of
> >>> nextval and setval, which is obviously an error.
> >>
> >> I use white_function_list for that, I have about 450 functions that
> >> are DDL/DML requests, so I only list the read only functions
> >>
> >>> On your backend configuration, you set backend_hostname0, and then go
> >>> directly to backend_hostname7. It may be an issue. Try to set them in
> >>> order (O, then 1, then 2). Not sure it has a real value, I never tried
> >>> that, but it works for me when they are set in order, and without hole.
> >>
> >> It doesn't seems to disturb pgpool, but it was having problem starting
> >> without a node 0.
> >
> > Ok, I tried with a 3.1 config file, and I have this error :
> >
> > 2011-10-04 13:35:44 ERROR: pid 1251: add_to_patterns: invalid regex
> > pattern: ^getuseruid$
> >
> > config :
> >
> > white_function_list = 'getuseruid'
> >   # Comma separated list of function names
> >   # that don't write to database
> >   # Regexp are accepted
> > black_function_list = ''
> >
> 
> The above error is on FreeBSD.
> 
> On Debian pgpool starts, on FreeBSD, pgpool won't start. Missing dependency?
> 
> Pgpool on both OS are compiled : one from sources (Debian) and one
> from ports (FreeBSD).
> 

On 3.1, black_function_list and white_function_list are regular
expressions. I guess the patch wasn't checked on BSD (the patch coder
worked on Linux). But this is a bug that should be fixed.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgPool HA set up

2011-10-05 Thread Guillaume Lelarge
On Wed, 2011-10-05 at 09:38 +0100, Thom Brown wrote:
> Hi,
> 
> I want to be able to have a primary/standby PostgreSQL setup with
> streaming replication and using pgPool to deal with the load balancing
> and auto failover.  One question I have is can I have 2 instances of
> pgPool pointing to the same database servers?

Yes.

>   In addition to this,
> what if pgPool1 and the primary were in one data centre, pgPool2 and
> the standby were in another data centre, then connectivity went down
> between the data centres.  On top of this would be a connection load
> balancer to map incoming connections to one of the pgPool instances
> (in case one of the pgPool instances dies).

That would be a total mess :)

>   It looks like pgPool2
> would promote the standby to a primary, then when connectivity was
> restored, there'd be a split brain issue where write queries would
> randomly hit one of the servers, making them instantly out of sync.

Right.

> This seems like it should be a very common setup, so does pgPool have
> provisioning for this, like having a 3rd pgPool to manage them
> somehow?
> 

No, it's not possible right now, and there's no discussion between
developers to do something like this (at least on pgpool-hackers).

> Also, if there was a primary and 2 standbys, and the primary goes
> down, which promotes standby1, how does standby2 then subscribe to
> standby1 automatically?  And how does pgPool then know how to trigger
> failover on the next standby if the new primary fails?
> 

pgpool doesn't know which one to promote. It just calls a script when a
failover is needed. Now, you can have a "smart" script that will try to
understand which slave is the most uptodate, and promote only this one.
Keep in mind that the script is really executed when a node is detached,
meaning every node, even slaves one. So your script needs to check if
the detached node is the master one.

In your example, for standby2 to follow standby1 (if standby1 is the new
master), pgpool executes a script (see follow_master_command option).

> And when I set up pgPool today with a primary and standby using
> streaming replication, queries only seemed to hit the primary.  Any
> idea what I could have missed?

Setting load balancing? and having enough clients hitting your database?

>   Aren't SELECT queries supposed to be
> randomly sent to one of the servers?  I ran queries several times and
> never did any hit the standby.
> 

You almost surely did this with one or two clients only, which won't
work. Use pgbench with 10 or more clients.

> Just to note, the config changes were something like this:
> 
> failover_command = ' backend_* =  for load balancing>
> replication_mode = false
> load_balance_mode = true
> replicate_select = false
> backend_hostname0/port0... = 
> backend_hostname1/port1... = 
> 

So you set the load balancing mode. I guess you didn't have enough
clients.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgPool HA set up

2011-10-05 Thread Guillaume Lelarge
On Wed, 2011-10-05 at 10:13 +0100, Thom Brown wrote:
> On 5 October 2011 10:05, Guillaume Lelarge  wrote:
> > On Wed, 2011-10-05 at 09:38 +0100, Thom Brown wrote:
> >[...]
> >> This seems like it should be a very common setup, so does pgPool have
> >> provisioning for this, like having a 3rd pgPool to manage them
> >> somehow?
> >>
> >
> > No, it's not possible right now, and there's no discussion between
> > developers to do something like this (at least on pgpool-hackers).
> 
> So no-one has ever configured pgPool to have true HA?  Isn't there any
> kind of black magick trickery one can do with the existing config
> options to achieve this?
> 

I guess true HA really depends on your context.

Say we have two data centers (DC1 and DC2), two PostgreSQL servers (PG1
and PG2), and two pgpool servers (PGP1 and PGP2). I would have all users
access to the database through PGP1. Say that DC1 isn't available
anymore, what I would do is change the IPVS so that all users go through
PGP2, change PGP2 configuration so that it cannot access to PG1, and
make sure that PG2 is the new master. Which of course is not automatic,
there are a few steps that need manual work.

But actually, what you are asking for is quite hard to have.

> >> Also, if there was a primary and 2 standbys, and the primary goes
> >> down, which promotes standby1, how does standby2 then subscribe to
> >> standby1 automatically?  And how does pgPool then know how to trigger
> >> failover on the next standby if the new primary fails?
> >>
> >
> > pgpool doesn't know which one to promote. It just calls a script when a
> > failover is needed. Now, you can have a "smart" script that will try to
> > understand which slave is the most uptodate, and promote only this one.
> > Keep in mind that the script is really executed when a node is detached,
> > meaning every node, even slaves one. So your script needs to check if
> > the detached node is the master one.
> >
> > In your example, for standby2 to follow standby1 (if standby1 is the new
> > master), pgpool executes a script (see follow_master_command option).
> 
> Ah okay, I'll look into that.
> 

I'm interested in knowing any issues you can found while working on
this.

> >> And when I set up pgPool today with a primary and standby using
> >> streaming replication, queries only seemed to hit the primary.  Any
> >> idea what I could have missed?
> >
> > Setting load balancing? and having enough clients hitting your database?
> >
> >>   Aren't SELECT queries supposed to be
> >> randomly sent to one of the servers?  I ran queries several times and
> >> never did any hit the standby.
> >>
> >
> > You almost surely did this with one or two clients only, which won't
> > work. Use pgbench with 10 or more clients.
> 
> Yes, you're right.  I had 3 clients connecting, mainly calling
> pg_sleep so I could monitor it in pg_stat_activity on both servers.
> 
> >> Just to note, the config changes were something like this:
> >>
> >> failover_command = ' >> backend_* =  >> for load balancing>
> >> replication_mode = false
> >> load_balance_mode = true
> >> replicate_select = false
> >> backend_hostname0/port0... = 
> >> backend_hostname1/port1... = 
> >>
> >
> > So you set the load balancing mode. I guess you didn't have enough
> > clients.
> 
> At least you didn't spot anything horribly wrong with these options.
> 

Nope, seems good to me.

> So in load balancing mode, is backend_*0 regarded by pgPool to be the
> primary, or is pgPool clever and polls the servers to figure this out?
> 

You mean, in master_slave mode. AFAIR, yes, it is. But I'll check.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgPool HA set up

2011-10-05 Thread Guillaume Lelarge
On Wed, 2011-10-05 at 12:22 +0200, Guillaume Lelarge wrote:
> On Wed, 2011-10-05 at 10:13 +0100, Thom Brown wrote:
> > On 5 October 2011 10:05, Guillaume Lelarge  wrote:
> > > On Wed, 2011-10-05 at 09:38 +0100, Thom Brown wrote:
> > >[...]
> > >> This seems like it should be a very common setup, so does pgPool have
> > >> provisioning for this, like having a 3rd pgPool to manage them
> > >> somehow?
> > >>
> > >
> > > No, it's not possible right now, and there's no discussion between
> > > developers to do something like this (at least on pgpool-hackers).
> > 
> > So no-one has ever configured pgPool to have true HA?  Isn't there any
> > kind of black magick trickery one can do with the existing config
> > options to achieve this?
> > 
> 
> I guess true HA really depends on your context.
> 
> Say we have two data centers (DC1 and DC2), two PostgreSQL servers (PG1
> and PG2), and two pgpool servers (PGP1 and PGP2). I would have all users
> access to the database through PGP1. Say that DC1 isn't available
> anymore, what I would do is change the IPVS so that all users go through
> PGP2, change PGP2 configuration so that it cannot access to PG1, and
> make sure that PG2 is the new master. Which of course is not automatic,
> there are a few steps that need manual work.
> 
> But actually, what you are asking for is quite hard to have.
> 
> > >> Also, if there was a primary and 2 standbys, and the primary goes
> > >> down, which promotes standby1, how does standby2 then subscribe to
> > >> standby1 automatically?  And how does pgPool then know how to trigger
> > >> failover on the next standby if the new primary fails?
> > >>
> > >
> > > pgpool doesn't know which one to promote. It just calls a script when a
> > > failover is needed. Now, you can have a "smart" script that will try to
> > > understand which slave is the most uptodate, and promote only this one.
> > > Keep in mind that the script is really executed when a node is detached,
> > > meaning every node, even slaves one. So your script needs to check if
> > > the detached node is the master one.
> > >
> > > In your example, for standby2 to follow standby1 (if standby1 is the new
> > > master), pgpool executes a script (see follow_master_command option).
> > 
> > Ah okay, I'll look into that.
> > 
> 
> I'm interested in knowing any issues you can found while working on
> this.
> 
> > >> And when I set up pgPool today with a primary and standby using
> > >> streaming replication, queries only seemed to hit the primary.  Any
> > >> idea what I could have missed?
> > >
> > > Setting load balancing? and having enough clients hitting your database?
> > >
> > >>   Aren't SELECT queries supposed to be
> > >> randomly sent to one of the servers?  I ran queries several times and
> > >> never did any hit the standby.
> > >>
> > >
> > > You almost surely did this with one or two clients only, which won't
> > > work. Use pgbench with 10 or more clients.
> > 
> > Yes, you're right.  I had 3 clients connecting, mainly calling
> > pg_sleep so I could monitor it in pg_stat_activity on both servers.
> > 
> > >> Just to note, the config changes were something like this:
> > >>
> > >> failover_command = ' > >> backend_* =  > >> for load balancing>
> > >> replication_mode = false
> > >> load_balance_mode = true
> > >> replicate_select = false
> > >> backend_hostname0/port0... = 
> > >> backend_hostname1/port1... = 
> > >>
> > >
> > > So you set the load balancing mode. I guess you didn't have enough
> > > clients.
> > 
> > At least you didn't spot anything horribly wrong with these options.
> > 
> 
> Nope, seems good to me.
> 
> > So in load balancing mode, is backend_*0 regarded by pgPool to be the
> > primary, or is pgPool clever and polls the servers to figure this out?
> > 
> 
> You mean, in master_slave mode. AFAIR, yes, it is. But I'll check.
> 

And I was wrong. At least when you first start pgpool.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgPool HA set up

2011-10-05 Thread Guillaume Lelarge
On Wed, 2011-10-05 at 11:44 +0100, Thom Brown wrote:
> On 5 October 2011 11:40, Guillaume Lelarge  wrote:
> > On Wed, 2011-10-05 at 12:22 +0200, Guillaume Lelarge wrote:
> >> On Wed, 2011-10-05 at 10:13 +0100, Thom Brown wrote:
> >> > On 5 October 2011 10:05, Guillaume Lelarge  
> >> > wrote:
> >> > > On Wed, 2011-10-05 at 09:38 +0100, Thom Brown wrote:
> >> > >[...]
> >> > >> This seems like it should be a very common setup, so does pgPool have
> >> > >> provisioning for this, like having a 3rd pgPool to manage them
> >> > >> somehow?
> >> > >>
> >> > >
> >> > > No, it's not possible right now, and there's no discussion between
> >> > > developers to do something like this (at least on pgpool-hackers).
> >> >
> >> > So no-one has ever configured pgPool to have true HA?  Isn't there any
> >> > kind of black magick trickery one can do with the existing config
> >> > options to achieve this?
> >> >
> >>
> >> I guess true HA really depends on your context.
> >>
> >> Say we have two data centers (DC1 and DC2), two PostgreSQL servers (PG1
> >> and PG2), and two pgpool servers (PGP1 and PGP2). I would have all users
> >> access to the database through PGP1. Say that DC1 isn't available
> >> anymore, what I would do is change the IPVS so that all users go through
> >> PGP2, change PGP2 configuration so that it cannot access to PG1, and
> >> make sure that PG2 is the new master. Which of course is not automatic,
> >> there are a few steps that need manual work.
> >>
> >> But actually, what you are asking for is quite hard to have.
> 
> I understand that MySQL cluster suite (or whatever it's called) has a
> master controller which provides this somehow.
> 

Not sure how it works, but it would be interesting to know.

> >> > So in load balancing mode, is backend_*0 regarded by pgPool to be the
> >> > primary, or is pgPool clever and polls the servers to figure this out?
> >> >
> >>
> >> You mean, in master_slave mode. AFAIR, yes, it is. But I'll check.
> >>
> >
> > And I was wrong. At least when you first start pgpool.
> 
> How does it then know where to direct write queries to?
> 

At the beginning, it always sends the write queries to backend 0.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] slow pgpool-II-3.1

2011-10-06 Thread Guillaume Lelarge
On Thu, 2011-10-06 at 14:36 +0200, Armin Nesiren wrote:
> Hi everyone,
> 
> I'm experiencing performance issues with pgpool-3.1
> Problem is that when I connect through pgpool to database, database works
> slower than
> when I connect directly to master. In this test case, I have disabled node2,
> just to check performance
> directly and through pgpool.
> 
> What can be a problem?

If I understand correctly, you only have one PostgreSQL server. And your
client goes through pgpool to reach the PostgreSQL server. How can you
expect that it would work faster that one PostgreSQL server alone?

It'll work faster only if you have more than one PostgreSQL server. And
more than one client.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] slow pgpool-II-3.1

2011-10-06 Thread Guillaume Lelarge
On Thu, 2011-10-06 at 14:56 +0200, Armin Nesiren wrote:
> On Thu, Oct 6, 2011 at 2:48 PM, Guillaume Lelarge 
> wrote:
> 
> > On Thu, 2011-10-06 at 14:36 +0200, Armin Nesiren wrote:
> > > Hi everyone,
> > >
> > > I'm experiencing performance issues with pgpool-3.1
> > > Problem is that when I connect through pgpool to database, database works
> > > slower than
> > > when I connect directly to master. In this test case, I have disabled
> > node2,
> > > just to check performance
> > > directly and through pgpool.
> > >
> > > What can be a problem?
> >
> > If I understand correctly, you only have one PostgreSQL server. And your
> > client goes through pgpool to reach the PostgreSQL server. How can you
> > expect that it would work faster that one PostgreSQL server alone?
> >
> > It'll work faster only if you have more than one PostgreSQL server. And
> > more than one client.
> 
> 
> No, with two servers (two nodes) work slower, also with one server through
> pgpool
> work slower than directly, I would expect to work same through pgpool and
> directly.
> 

With one server and one client, through pgpool, that can't be the same.
pgpool decodes all the client's queries, which takes some time. IOW,
there is an overhead. But when you have lots of clients, they usually
are faster. And really faster with more than one PostgreSQL server.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] slow pgpool-II-3.1

2011-10-06 Thread Guillaume Lelarge
On Thu, 2011-10-06 at 16:28 +0200, Olivier NOEL wrote:
> 2011/10/6 Guillaume Lelarge :
> > On Thu, 2011-10-06 at 14:56 +0200, Armin Nesiren wrote:
> >> On Thu, Oct 6, 2011 at 2:48 PM, Guillaume Lelarge 
> >> wrote:
> >>
> >> > On Thu, 2011-10-06 at 14:36 +0200, Armin Nesiren wrote:
> >> > > Hi everyone,
> >> > >
> >> > > I'm experiencing performance issues with pgpool-3.1
> >> > > Problem is that when I connect through pgpool to database, database 
> >> > > works
> >> > > slower than
> >> > > when I connect directly to master. In this test case, I have disabled
> >> > node2,
> >> > > just to check performance
> >> > > directly and through pgpool.
> >> > >
> >> > > What can be a problem?
> >> >
> >> > If I understand correctly, you only have one PostgreSQL server. And your
> >> > client goes through pgpool to reach the PostgreSQL server. How can you
> >> > expect that it would work faster that one PostgreSQL server alone?
> >> >
> >> > It'll work faster only if you have more than one PostgreSQL server. And
> >> > more than one client.
> >>
> >>
> >> No, with two servers (two nodes) work slower, also with one server through
> >> pgpool
> >> work slower than directly, I would expect to work same through pgpool and
> >> directly.
> >>
> >
> > With one server and one client, through pgpool, that can't be the same.
> > pgpool decodes all the client's queries, which takes some time. IOW,
> > there is an overhead. But when you have lots of clients, they usually
> > are faster. And really faster with more than one PostgreSQL server.
> 
> And it's not. Ok, there is some overhead, but it's veeery slow.
> 

How did you check that?

You may be right in a specific setting, but I have no issues getting
better performance with pgpool.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] How to configure pgpool for pool conexions..

2011-10-06 Thread Guillaume Lelarge
On Thu, 2011-10-06 at 10:59 -0500, Matias Israel Malpica Escobar wrote:
> Hi everyone i´ve been trying to understand and configure pgpool for a pool of 
> connections (not sure if that is the term), i already follow a manual and 
> confiigure it like this:
> 
> listen_addresses = '*'
> port = 
> pcp_port = 9898
> socket_dir = '/var/run/postgresql'
> pcp_socket_dir = '/var/run/postgresql'
> backend_socket_dir = '/var/run/postgresql'
> pcp_timeout = 10
> num_init_children = 32
> max_pool = 4
> child_life_time = 300
> connection_life_time = 0
> child_max_connections = 0
> client_idle_limit = 0
> authentication_timeout = 60
> logdir = '/var/run/postgresql'
> replication_mode = false
> load_balance_mode = false
> replication_stop_on_mismatch = false
> replicate_select = false
> reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT'
> print_timestamp = true
> master_slave_mode = false
> connection_cache = true
> health_check_timeout = 20
> health_check_period = 60
> health_check_user = 'pgpool2'
> failover_command = ''
> failback_command = ''
> insert_lock = false
> ignore_leading_white_space = true
> log_statement = false
> log_connections = false
> log_hostname = false
> parallel_mode = false
> enable_query_cache = false
> pgpool2_hostname = 'pgsql1'
> system_db_hostname = 'localhost'
> system_db_port = 5432
> system_db_dbname = 'pgpool'
> system_db_schema = 'pgpool_catalog'
> system_db_user = 'pgpool'
> system_db_password = ''
> backend_hostname0 = '192.168.0.3'
> backend_port0 = 5432
> backend_weight0 = 1
> backend_hostname1 = '192.168.0.4'
> backend_port1 = 5432
> backend_weight1 = 1
> enable_pool_hba = false
> recovery_user = 'pgpool2'
> recovery_password = ''
> recovery_1st_stage_command = ''
> recovery_2nd_stage_command = ''
> recovery_timeout = 90
> After this i startes pgpool and everything seems to be working, how do i 
> actually test it?
> 
> Now i have a couple of questions.
> 
> With this i understand that i am creating 4 pools for 32 connections each, so 
> it would be 128 connections?
> 

Yes, but only 32 active at one time.

> The purpose of this is, first allow pgpool to handle connections instead of 
> postygres so the end user do not receive an error, adn second use the same 
> connection to dispach several request that are alike...
> 

Obviously, if your user tries to connect to a database that doesn't
exist, he'll get an error message. If he tries to execute a badly
written query, he'll also get an error message.

pgpool will be able to reuse a connection if the user wants to connect
to the same database with the same user.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] slow pgpool-II-3.1

2011-10-06 Thread Guillaume Lelarge
On Thu, 2011-10-06 at 17:27 +0200, Olivier NOEL wrote:
> 2011/10/6 Guillaume Lelarge :
> 
> [...]
> 
> >> And it's not. Ok, there is some overhead, but it's veeery slow.
> >>
> >
> > How did you check that?
> >
> > You may be right in a specific setting, but I have no issues getting
> > better performance with pgpool.
> 
> We tested our java webapp with pgpool and without pgpool, same
> servers, we only change the target IP in the JDBC config file in
> Tomcat.
> 

I suppose you don't use a pooling mode in your java app? because they
may interfere.

> We have a small XML processing servlet with informations to insert in
> the databases (streaming replication). We verified that all requests a
> balanced.
> 
> XML sizes varies from 300KB to 3MB.
> 

Not sure what you mean with this. Are your queries this size? What do
you do with the XML? what kind of queries (SELECT, INSERT)?

> Time to process the file completely for a fully functional database :
> 
> - with pgpool : 20-45min (20min for the smaller ones to 45min for the big one)
> - without pgpool : 4-15min
> 

How many users? same PostgreSQL database, and same PostgreSQL user?

> Then we tested browsing in our webapp :
> 
> - with pgpool : 30-45s to display a list of full customers
> informations (depending on the numbers of customers, 2400 to 12000
> customers on the same page)
> - without pgpool : 5-10s
> 

Same questions. How many users try to connect to pgpool? how long last
their sessions? what kind of queries?


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] How to configure pgpool for pool conexions..

2011-10-06 Thread Guillaume Lelarge
On Thu, 2011-10-06 at 11:13 -0500, Matias Israel Malpica Escobar wrote:
> Hi thanks for your answers, what i wanted to say about the connections and 
> errors from pgpool was that, for what i understand postgres returns an error 
> if the number of connections are higher than its maximum, and pgpool puts the 
> remaining connections in a queue is that right? I am actually doing it with 
> the configuration that i have? Is there any way to test it?
> 

Yes, that's right. You don't get error message telling you the usual
FATAL message about max_connections.

I don't know a quick way to test it. Perhaps with pgbench and a number
of clients a bit higher than the max_connections of PostgreSQL? I would
first try that.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] slow pgpool-II-3.1

2011-10-08 Thread Guillaume Lelarge
On Thu, 2011-10-06 at 18:44 +0200, Olivier NOEL wrote:
> 2011/10/6 Guillaume Lelarge :
> > On Thu, 2011-10-06 at 17:27 +0200, Olivier NOEL wrote:
> >> 2011/10/6 Guillaume Lelarge :
> >>
> >> [...]
> >>
> >> >> And it's not. Ok, there is some overhead, but it's veeery slow.
> >> >>
> >> >
> >> > How did you check that?
> >> >
> >> > You may be right in a specific setting, but I have no issues getting
> >> > better performance with pgpool.
> >>
> >> We tested our java webapp with pgpool and without pgpool, same
> >> servers, we only change the target IP in the JDBC config file in
> >> Tomcat.
> >>
> >
> > I suppose you don't use a pooling mode in your java app? because they
> > may interfere.
> 
> No pooling, just the basic configuration of JDBC.
> 

Is JDBC autocommit on?

> >> We have a small XML processing servlet with informations to insert in
> >> the databases (streaming replication). We verified that all requests a
> >> balanced.
> >>
> >> XML sizes varies from 300KB to 3MB.
> >>
> >
> > Not sure what you mean with this. Are your queries this size? What do
> > you do with the XML? what kind of queries (SELECT, INSERT)?
> 
> My XML contains the data I have to insert in my database (list,
> informations about customers, etc.), data is prepared and inserted.
> All kind of queries DDL/DML/SELECT, etc.

> >> Time to process the file completely for a fully functional database :
> >>
> >> - with pgpool : 20-45min (20min for the smaller ones to 45min for the big 
> >> one)
> >> - without pgpool : 4-15min
> >>
> >
> > How many users? same PostgreSQL database, and same PostgreSQL user?
> 
> 120 simultaneous users (webapp, max JDBC connections 25 per user),
> same database and user, but we have the same problem with every
> database.
> 
> >> Then we tested browsing in our webapp :
> >>
> >> - with pgpool : 30-45s to display a list of full customers
> >> informations (depending on the numbers of customers, 2400 to 12000
> >> customers on the same page)
> >> - without pgpool : 5-10s
> >>
> >
> > Same questions. How many users try to connect to pgpool? how long last
> > their sessions? what kind of queries?
> 
> We have 120 simultaneous users with a maximum of 25 connections per
> user (1000 connections per server, 3000 connections in pgpool)
> 
> Sessions? in JDBC? in webapp? in pgpool?

Sessions in PostgreSQL.

> All kind of queries DML/DDL/SELECT, etc.
> 

The numbers you provided show your app to be a lot slower with pgpool
than without. I fail to see why. In my experience, it usually is much
faster.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgpool-II 3.0.5 released

2011-11-07 Thread Guillaume Lelarge
On Mon, 2011-11-07 at 09:18 +0100, Stevo Slavić wrote:
> Congrats on the release!
> 
> Is any of the resolved bugs known to be present in 3.1 branch too?
> Need to decide whether to use 3.1 or 3.0.5 for a production system.
> 
> I'm especially interested in "Fix bug which does not update the node
> status when reattaching the node in raw mode(Guillaume Lelarge)"
> 

Don't know about the others, but the one you're referring to is fixed on
both releases.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgpool-II child process is segfaulting

2011-11-09 Thread Guillaume Lelarge
On Wed, 2011-11-09 at 13:40 -0430, Lazaro Rubén García Martinez wrote:
> Tatsuo, thank you very much for your answer, but when I execute:
> 
> cvs -d :pserver:anonym...@cvs.pgfoundry.org:/cvsroot/pgpool login
> 
> This error is shown:
> 
> cvs [login aborted]: connect to [cvs.pgfoundry.org]:2401 failed: Connection 
> timed out
> 
> I have access to internet by a proxy there is in my organization, that means 
> I have not free access to internet.
> 

It isn't because of your proxy. pgfoundry was unavailable for a few
days.

> Could you tell me, why is the cause of this problem, or if you have time, 
> could you send me V3_1_STABLE to this email address?
> 
> lazaro3...@gmail.com
> 
> 
> Is very important for my download the V3_1_STABLE.
> 

It seems you should be able to download it right now.

BTW, pgpool moved to git quite recently. So you can grab it from
git.postgresql.org, using:

git clone git://git.postgresql.org/git/pgpool2.git

and, then

git checkout V3_1_STABLE


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] pgpool-II 3.0.5 released

2011-11-11 Thread Guillaume Lelarge
On Fri, 2011-11-11 at 01:27 -0800, Sandeep Thakkar wrote:
> Hi,
> 
> 
> Why one more release of pgpool-II 3.0 series when we have pgpool-II
> 3.1 series released already? We were using pgpool-II 3.0.3 and then
> updated to 3.1. Now, you have released 3.0.5. Which one should we use
> for production? 
> 

For quite the same reason PostgreSQL gets out minor releases for older
branch: that way, you don't have to get the latest major release if an
older one works for you.



-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Authentication method used for sr_check_password, health_check_password and recovery_password

2011-11-20 Thread Guillaume Lelarge
On Sun, 2011-11-20 at 08:13 +0900, Tatsuo Ishii wrote:
> > Thank you very much for the answer.
> > Is there a plan for using sr_check_password in the next release of pgpool 
> > 3.1 series?
> 
> Yes, it's in my plan. Unless supporting sr_check_password is too
> invasive...

Sorry, but I disagree. Either it is a bug and it should get fixed, or it
isn't a bug, and this new feature should go into 3.2. Changing behaviour
between minor releases should not happen.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Authentication method used for sr_check_password, health_check_password and recovery_password

2011-11-20 Thread Guillaume Lelarge
On Sun, 2011-11-20 at 18:31 +0900, Tatsuo Ishii wrote:
> > On Sun, 2011-11-20 at 08:13 +0900, Tatsuo Ishii wrote:
> >> > Thank you very much for the answer.
> >> > Is there a plan for using sr_check_password in the next release of 
> >> > pgpool 3.1 series?
> >> 
> >> Yes, it's in my plan. Unless supporting sr_check_password is too
> >> invasive...
> > 
> > Sorry, but I disagree. Either it is a bug and it should get fixed, or it
> > isn't a bug, and this new feature should go into 3.2. Changing behaviour
> > between minor releases should not happen.
> 
> If sr_check_password is not in 3.1, you are argument is perfectly
> adequate. But in 3.1 sr_check_password is there but it's not
> used. Doesn't it a bug?

Could be a forgotten feature. In that case, I advocate to make it work
in 3.1.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general


Re: [Pgpool-general] Authentication method used for sr_check_password, health_check_password and recovery_password

2011-11-20 Thread Guillaume Lelarge
On Sun, 2011-11-20 at 17:24 -0430, Lazaro Rubén García Martinez wrote:
> I think this feature is very important, because having  trust acces in 
> pg_hba.conf is not a good idea.

I understand that and I agree with you. The problem is not on the
feature itself, but on which release it should be delivered. If the
feature is really urgent to get out there, then we should release 3.2
quickly. We shouldn't put it in 3.1.whatever because 3.1.whatever could
get out before 3.2.

Minor releases shouldn't change behaviour apart from bugfixes. That's an
important part of the trust you can have in a software. If we start to
add features on bugfix releases, many people will stop doing minor
updates on pgpool, afraid of bugs which might be included with new
features. I know I'll do if this will happen, and I won't encourage my
customers to upgrade their pgpool.

So, definite +1 to add this feature to pgpool, +1 to add it to 3.2, -1
to add it as a bugfix in 3.1.1. It definitely is not a bugfix.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com

___
Pgpool-general mailing list
Pgpool-general@pgfoundry.org
http://pgfoundry.org/mailman/listinfo/pgpool-general