On 04/07/2011 03:46, Tatsuo Ishii wrote:
So here is a first patch ready for review.

   * it refactor "pcp processes info" related code to return all processes
   * info from backend, similar to the "show pool_pools" query
   * add pgpool process PID and backend id fields
   * add the ability to show all these informations from pcp_proc_info
   * command
   * no change to the pcp_proc_info command default behavior
   * new fields are added as last fields in the proc_info command only with
   * the -a switch (both verbose or not)

As a remember, I had to add fields "pgpool process PID" and "backend
id" because I will need them in pgpool_adm.

Thank you for your next comments and review.

I have tried your patches.

When pcp_proc_info is executed with no pid argument, it works
fine. However if pid is given it gaves BackendError.

$ pcp_proc_info 10 "" 9898 postgres pgpoolAdmin
test t-ishii 2011-07-04 10:40:39 2011-07-04 10:40:46 3 0 2 1968 1
test t-ishii 2011-07-04 10:40:39 2011-07-04 10:40:46 3 0 2 1969 1
test t-ishii 2011-07-04 10:40:39 2011-07-04 10:41:25 3 0 1 2065 0
test t-ishii 2011-07-04 10:40:39 2011-07-04 10:41:25 3 0 1 2064 0
$ pcp_proc_info 10 "" 9898 postgres pgpoolAdmin 1968
BackendError

And it's right :)

You gave here the postgresql backend PID, not a valid pgpool child PID. As I wrote, I actually added pgpool's childs PID, you can see them using the -a switch on the command line.

(ioguix@arval)- ./bin/pcp_proc_info 10 127.0.0.1 9898 pgpool_adm pgpass
pagila postgres 2011-07-04 12:57:30 2011-07-04 13:01:23 3 0 1 14883 0
postgres ioguix 2011-07-04 12:57:30 2011-07-04 13:01:58 3 0 1 14915 1
pagila postgres 2011-07-04 12:57:30 2011-07-04 13:01:06 3 0 1 14855 1
pagila ioguix 2011-07-04 12:57:30 2011-07-04 13:00:06 3 0 1 14810 1
postgres postgres 2011-07-04 12:57:30 2011-07-04 13:00:15 3 0 1 14815 1

(ioguix@arval)- ./bin/pcp_proc_info 10 127.0.0.1 9898 pgpool_adm pgpass -a
pagila postgres 2011-07-04 12:57:30 2011-07-04 13:01:23 3 0 1 14883 0 14683 0 postgres ioguix 2011-07-04 12:57:30 2011-07-04 13:01:58 3 0 1 14915 1 14683 0 pagila postgres 2011-07-04 12:57:30 2011-07-04 13:01:06 3 0 1 14855 1 14684 0
  2011-07-04 12:57:30  0 0 0 0 0 14684 0
pagila ioguix 2011-07-04 12:57:30 2011-07-04 13:00:06 3 0 1 14810 1 14685 0
  2011-07-04 12:57:30  0 0 0 0 0 14685 0
postgres postgres 2011-07-04 12:57:30 2011-07-04 13:00:15 3 0 1 14815 1 14686 0
  2011-07-04 12:57:30  0 0 0 0 0 14686 0

(ioguix@arval)- ./bin/pcp_proc_info 10 127.0.0.1 9898 pgpool_adm pgpass 14683
pagila postgres 2011-07-04 12:57:30 2011-07-04 13:01:23 3 0 1 14883 0
postgres ioguix 2011-07-04 12:57:30 2011-07-04 13:01:58 3 0 1 14915 1


--
Jehan-Guillaume (ioguix) de Rorthais
DBA
http://www.dalibo.com
_______________________________________________
Pgpool-hackers mailing list
[email protected]
http://pgfoundry.org/mailman/listinfo/pgpool-hackers

Reply via email to