[Pgpool-hackers] First pcp command as PostgreSQL function

Tatsuo Ishii ishii at sraoss.co.jp
Thu Apr 21 23:06:11 UTC 2011


>> Sorry but I couldn't apply your patches nor make working it.
>> Your patches produced lots of following messages:
>> 
>> Reversed (or previously applied) patch detected!  Assume -R? [n] 
> 
> Look like you tried to apply them multiple times and had an unstable
> source tree ?

I tried to apply split_reporting_functions-2.patch after
split_reporting_functions-1.patch, or just
split_reporting_functions-2.patch without success.

>> (I fixed rejecting patches caused by Toshihiro's commit)
>> 
>> I couldn't solve undefined reference to get_config().
>> 
>> /home/t-ishii/work/pgfoundry/tmp/pgpool-II/pcp_child.c:911: undefined
>> reference to `get_config'
> 
> get_config is in the first patch about splitting the report functions
> 
>> It seems the function body does not exist in your patches at all.
>> 
>> Please re-submit complete patches against CVS HEAD so that I can test
>> it.
> 
> PFA a cumulative patch synched with current CVS
> 
> I was able to build pgpool after applying the patch with  the following
> command:
> 
>   patch -p1 < /tmp/split_report_funcs+pcp_pool_status.patch
> 
> Originally, I decided to split both patches for ease of review, sorry if
> it was confusing :(

Thanks! This is really helpfull! Regarding the patches size, one large
patch is not problem at least for me.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp

>> On 03/04/2011 01:38, Tatsuo Ishii wrote:
>>>>>> Hello,
>>>>>>
>>>>>> Following our previous discussions I created a PostgreSQL contrib module
>>>>>> which brings pgpool's pcp command as function in PostgreSQL. I called it
>>>>>> pgpool_adm, any better ideas ?
>>>>>
>>>>> Great! I think "pgpool_adm" is fine.
>>>>>
>>>>>> As a first step, I decided to focus on one function only: pcp_node_info.
>>>>>> I'll add other ones as soon as this one will be committable.
>>>>>
>>>>> I see. BTW, are you going to implement a function for "show
>>>>> pool_status"?
>> 
>> Here is a new version of the contrib module, including support for
>> pcp_pool_status.
>> 
>> It requires a patched version of pgpool with my 2 patches
>> "split_reporting_functions-1.patch" and "pcp_pool_status-2.patch".
>> 
>> Follow the same installation instructions than in my previous emails to
>> install this module and, optionally some foreign server wrapper.
>> 
>> Then:
>> 
>>   pgpool=> SELECT * FROM pcp_pool_status('127.0.0.1', 10, 9898,
>> 'pgpool_adm', 'password');
>> 
>> or, if you are using foreign server capability in postgresql 8.4+:
>> 
>>   pgpool=> SELECT * FROM pcp_pool_status('pgpool0');
>> 
>> Feedbacks and comments ?
>> 
>>>>>> INSTALL: (tested against current 9.1devel HEAD)
>>>>>>
>>>>>>   $ cd $PGSRC/contrib
>>>>>>   $ tar zxf pgpool_adm.tgz
>>>>>>   $ cd pgpool_adm
>>>>>>   $ make && sudo make install
>>>>>>
>>>>>> then:
>>>>>>
>>>>>>   $ psql pgpool
>>>>>>   CREATE SCHEMA pgpool;
>>>>>>   CREATE EXTENSION pgpool_adm WITH SCHEMA pgpool ;
>>>>>>   SELECT * FROM pgpool.pcp_node_info(0, 'localhost', 10, 9898,
>>>>>> 'pgpool_adm', 'password');
>>>>>>      host    | port |             status              |   weight
>>>>>>   -----------+------+---------------------------------+-------------
>>>>>>    localhost | 5491 | Waiting for connection to start | 1.46602e+13
>>>>>>   (1 ligne)
>>>>>>
>>>>>> If you don't want/cannot test with 9.1, just adapt and run the "CREATE
>>>>>> FUNCTION" query located in pgpool_adm/pgpool_adm--1.0.sql.
>>>>>>
>>>>>> NOTE:
>>>>>> I had to mess a bit to make the compilation work out of the box because
>>>>>> of my setup of pgpool installing stuffs in /usr/local/{lib,include}.
>>>>>> Basically editing my system ldd setup and configuring postgresql with
>>>>>> "--with-libraries" and "--with-includes". Drop me a mail if you have any
>>>>>> trouble.
>>>>>>
>>>>>> TODO:
>>>>>>   * I will try to make it work with foreign server and user mappings so
>>>>>> we will not have to give all servers parameters (host, port, timeout),
>>>>>> but most importantly, not have to write in clear text authentication
>>>>>> parameters.
>>>>>>   * Why do we backend_weight/RAND_MAX in the code ?
>>>>>
>>>>> To normalize backend weight.
>>>>>
>>>>>> Feedback & comments ?
>>>>>> - -- 
>>>>>> Jehan-Guillaume (ioguix) de Rorthais
>>>>>> DBA
>>>>>> http://www.dalibo.com
>>>>>> 
> 
> 
> - -- 
> Jehan-Guillaume (ioguix) de Rorthais
> DBA
> http://www.dalibo.com
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk2wmOQACgkQXu9L1HbaT6K83gCglLIu3t0RseXmZTMkovLkhQGE
> EcgAn1WuKvHuD92R5leKDOVO6wSAw3/v
> =oJlt
> -----END PGP SIGNATURE-----


More information about the Pgpool-hackers mailing list