Le 25/07/2010 04:14, Tatsuo Ishii a écrit :
>> I was working on my patch when I noticed that pcp_proc_info doesn't work
>> anymore on HEAD. I mean on a vanilla HEAD (ie, without any patchs, clear
>> as it could come from CVS).
>>
>> See this example:
>>
>> guilla...@laptop:/opt/pgpool-head$ ps -ef | grep pgpool
>> 1000     11350 13641  0 17:25 pts/1    00:00:00 bin/pgpool -f
>> etc/pgpool.conf -n
>> 1000     11351 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11352 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11353 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11354 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11355 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11356 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11357 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11358 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11359 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11360 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11361 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11362 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11363 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11364 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11365 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11366 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11367 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11368 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11369 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11370 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11371 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11372 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11373 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11374 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11375 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11376 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11377 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11378 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11379 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11380 11350  0 17:25 pts/1    00:00:00 pgpool: wait for
>> connection request
>> 1000     11381 11350  0 17:25 pts/1    00:00:00 pgpool: guillaume
>> postgres [local] idle
>> 1000     11382 11350  0 17:25 pts/1    00:00:00 pgpool: guillaume b1
>> 127.0.0.1(37793) idle
>> 1000     11383 11350  0 17:25 pts/1    00:00:00 pgpool: PCP: wait for
>> connection request
>> 1000     11384 11350  0 17:25 pts/1    00:00:00 pgpool: worker process
>>
>> 1000     11728 14734  0 17:41 pts/2    00:00:00 grep --color=auto pgpool
>>
>> So, I have two psql connected to PostgreSQL via pgpool. Let's try to get
>> info from pid 11381 and 11382:
>>
>> guilla...@laptop:/opt/pgpool-head$ bin/pcp_proc_info 10 localhost 9898
>> postgres toto 11382
>> guilla...@laptop:/opt/pgpool-head$ bin/pcp_proc_info 10 localhost 9898
>> postgres toto 11381
>>
>> Nothing at all. That's already weird. If I look at all processes, I
>> finally found the pid:
>>
>> guilla...@laptop:/opt/pgpool-head$ bin/pcp_proc_info 10 localhost 9898
>> postgres toto 11351
>> b1 guillaume 1279985121 1279985142 3 0 1
>>
>> But if I look at  my ps output, 11351 is waiting for a connection.
>>
>> I tried to figure what was going one, but failed. If anyone has any
>> ideas, I'm open to hear them :)
>>
>> PS: tried on V2_3_STABLE, works great.
> 
> I suspect that in your build pgpool is not linked against shared
> memory staffs. The info pcp_proc_info looking into is placed on the
> shared_memory handled by pool_config.l. What does nm pool_config.o
> show? Mine is like below, which contains the reference to
> pool_shared_memory_create. How about yours?
> 
> ]$ nm pool_config.o
> 00001154 b Lineno
>          U _IO_getc
>          U __errno_location
>          U atof
>          U atoi
>          U atol
> 00005a45 t clear_host_entry
>          U clearerr
> 00000004 d default_reset_query_list
> 0000593a T eval_logical
>          U exit
> 00005700 t extract_string
> 00005980 t extract_string_tokens
>          U fclose
>          U ferror
>          U fopen
>          U fprintf
>          U fread
>          U free
>          U fwrite
>          U gethostname
>          U getpid
> 00000b95 t input
> 00000040 b localhostname.0
>          U malloc
>          U memset
>          U mypid
> 00005765 t parse_bool_with_len
> 00000004 C pool_config
>          U pool_debug
>          U pool_error
> 00001af1 T pool_get_config
> 0000165c T pool_init_config
>          U pool_log
>          U pool_memset_system_db_info
>          U pool_query_cache_table_exists
>          U pool_shared_memory_create <-- this one
> [snip]

$ nm pool_config.o | grep pool_shared_memory_create
                 U pool_shared_memory_create

So I suppose it is. I attached the complete output.


-- 
Guillaume
 http://www.postgresql.fr
 http://dalibo.com
0000000000000584 r .LC128
0000000000000000 r .LC135
0000000000002160 b Lineno
                 U _IO_getc
                 U __errno_location
                 U __fprintf_chk
                 U __stack_chk_fail
                 U __strdup
                 U calloc
                 U clearerr
0000000000000010 d default_reset_query_list
0000000000000120 T eval_logical
                 U exit
0000000000000270 t extract_string
                 U fclose
                 U ferror
                 U fopen
                 U fread
                 U free
                 U fwrite
                 U gethostname
                 U getpid
0000000000002020 b localhostname.8484
                 U malloc
                 U mypid
0000000000000008 C pool_config
                 U pool_debug
                 U pool_error
0000000000001a70 T pool_get_config
00000000000002d0 T pool_init_config
                 U pool_log
                 U pool_memset_system_db_info
                 U pool_query_cache_table_exists
                 U pool_shared_memory_create
                 U realloc
                 U stderr
                 U stdin
                 U stdout
                 U strcmp
                 U strlen
                 U strncasecmp
                 U strncmp
                 U strncpy
                 U strtod
                 U strtok
                 U strtol
0000000000000008 C system_db_info
0000000000000020 b tokens.12971
00000000000006c0 r yy_accept
00000000000007e0 r yy_base
0000000000002120 b yy_buffer_stack
0000000000002130 b yy_buffer_stack_max
0000000000002128 b yy_buffer_stack_top
0000000000002138 b yy_c_buf_p
0000000000000840 r yy_chk
0000000000000da0 T yy_create_buffer
0000000000000720 r yy_def
0000000000000640 T yy_delete_buffer
0000000000002150 b yy_did_buffer_switch_on_eof
00000000000002c0 r yy_ec
0000000000000830 t yy_fatal_error
0000000000000010 B yy_flex_debug
0000000000000000 T yy_flush_buffer
0000000000002148 b yy_hold_char
0000000000002140 b yy_init
0000000000000d10 t yy_init_buffer
0000000000002158 b yy_last_accepting_cpos
0000000000002154 b yy_last_accepting_state
0000000000000780 r yy_meta
000000000000214c b yy_n_chars
0000000000000920 r yy_nxt
0000000000000b70 T yy_scan_buffer
0000000000000c40 T yy_scan_bytes
0000000000000cf0 T yy_scan_string
0000000000002144 b yy_start
0000000000000ac0 T yy_switch_to_buffer
0000000000000260 T yyalloc
0000000000000860 t yyensure_buffer_stack
0000000000000630 T yyfree
0000000000000100 T yyget_debug
0000000000000090 T yyget_in
00000000000000b0 T yyget_leng
0000000000000080 T yyget_lineno
00000000000000a0 T yyget_out
00000000000000c0 T yyget_text
0000000000000000 B yyin
0000000000000004 C yyleng
0000000000000f10 T yylex
0000000000000760 T yylex_destroy
0000000000000000 D yylineno
0000000000000008 B yyout
00000000000006b0 T yypop_buffer_state
0000000000000a00 T yypush_buffer_state
0000000000000820 T yyrealloc
0000000000000e30 T yyrestart
0000000000000110 T yyset_debug
00000000000000e0 T yyset_in
00000000000000d0 T yyset_lineno
00000000000000f0 T yyset_out
0000000000000008 C yytext
_______________________________________________
Pgpool-hackers mailing list
[email protected]
http://pgfoundry.org/mailman/listinfo/pgpool-hackers

Reply via email to