[pgpool-general: 3279] Re: Execution of command failed

Bill W pgpool at aastral.net
Thu Nov 13 13:37:15 JST 2014


Okay thank you very much!
I appreciate your prompt response.



On 11/12/14, 11:14 PM, Tatsuo Ishii wrote:
>> I did try to use create extension pgpool_recovery;
>>
>> But it created 2 versions:
> 
> Shouldn't be a problem because PostgreSQL supports polymorphism in
> functions. pgpool should call the 4 parameters version.
> 
>> template1=# select proname,prosrc from pg_proc where proname like '%pool%';
>>        proname       |       prosrc
>> ---------------------+---------------------
>>  pgpool_recovery     | pgpool_recovery
>>  pgpool_recovery     | pgpool_recovery
>>  pgpool_remote_start | pgpool_remote_start
>>  pgpool_pgctl        | pgpool_pgctl
>>  pgpool_switch_xlog  | pgpool_switch_xlog
>>
>>
>>
>>
>> On 11/12/14, 11:05 PM, Tatsuo Ishii wrote:
>>>> Okay I just downloaded
>>>> http://www.pgpool.net/download.php?f=pgpool-II-3.4.0.tar.gz
>>>>
>>>> which shows date 2014-11-07
>>>> but pgpool-recovery.sql shows only 3 arguments:
>>>>
>>>> CREATE OR REPLACE FUNCTION pgpool_recovery(text, text, text)
>>>> RETURNS bool
>>>> AS '$libdir/pgpool-recovery', 'pgpool_recovery'
>>>> LANGUAGE C STRICT;
>>>>
>>>> Is that the correct tarball?
>>>
>>> Yes, but apparently pgpool-recovery.sql is outdated. I didn't notice
>>> that because I don' use the script these days. Instead I use CREATE
>>> EXTENSION command. Can you please execute following or use CREATE
>>> EXTENSION?
>>>
>>> CREATE OR REPLACE FUNCTION pgpool_recovery(text, text, text, text)
>>> RETURNS bool
>>> AS 'MODULE_PATHNAME', 'pgpool_recovery'
>>> LANGUAGE C STRICT;
>>>
>>> Best regards,
>>> --
>>> Tatsuo Ishii
>>> SRA OSS, Inc. Japan
>>> English: http://www.sraoss.co.jp/index_en.php
>>> Japanese:http://www.sraoss.co.jp
>>>
>>>> On 11/12/14, 10:37 PM, Tatsuo Ishii wrote:
>>>>>> Thank you for your quick reply!
>>>>>>
>>>>>> Ah yes I misunderstood.  I thought pgpool called the first stage script.
>>>>>>
>>>>>> Am I reading this right?  It looks like pgpool_recovery is being called
>>>>>> with 4 arguments, but the function only takes 3 arguments.
>>>>>
>>>>> Yes. From pgpool-II 3.4.0, pgpool_recovery starts to accept 4
>>>>> arguments. Probably your pgpool_recovery installation on PostgreSQL is
>>>>> outdated. Please update.
>>>>>
>>>>> From release note of 3.4:
>>>>> * Incompatible changes
>>>>> :
>>>>> :
>>>>>     - Recovery script now accepts 4 parameters, rather than 3 (the 4th
>>>>>       parameter is the port number of master PostgreSQL). Existing
>>>>>       3-parameter-style recovery scripts can be used if you don't care
>>>>>       about information provided by the 4th parameter.
>>>>>
>>>>> Best regards,
>>>>> --
>>>>> Tatsuo Ishii
>>>>> SRA OSS, Inc. Japan
>>>>> English: http://www.sraoss.co.jp/index_en.php
>>>>> Japanese:http://www.sraoss.co.jp
>>>>>
>>>>>> Postgres log: ------------------
>>>>>> 2014-11-12 21:43:36 EST template1 pgpool ERROR:  function
>>>>>> pgpool_recovery(unknown, unknown, unknown, unknown) does not exist at
>>>>>> character 8
>>>>>>
>>>>>> 2014-11-12 21:43:36 EST template1 pgpool HINT:  No function matches the
>>>>>> given name and argument types. You might need to add explicit type casts.
>>>>>>
>>>>>> 2014-11-12 21:43:36 EST template1 pgpool STATEMENT:  SELECT
>>>>>> pgpool_recovery('pgpool_basebackup', '10.0.51.62',
>>>>>> '/var/lib/pgsql/data', '5432')
>>>>>>
>>>>>> functions: ----------------------
>>>>>> template1=# \ef pgpool_recovery
>>>>>> No changes
>>>>>> template1=# select proname,prosrc from pg_proc where proname like '%pool%';
>>>>>>        proname       |       prosrc
>>>>>> ---------------------+---------------------
>>>>>>  pgpool_regclass     | pgpool_regclass
>>>>>>  pgpool_recovery     | pgpool_recovery
>>>>>>  pgpool_remote_start | pgpool_remote_start
>>>>>>  pgpool_pgctl        | pgpool_pgctl
>>>>>>  pgpool_switch_xlog  | pgpool_switch_xlog
>>>>>> (5 rows)
>>>>>>
>>>>>> Function: ---------------------
>>>>>> template1=# \ef pgpool_recovery
>>>>>> CREATE OR REPLACE FUNCTION public.pgpool_recovery(text, text, text)
>>>>>>  RETURNS boolean
>>>>>>  LANGUAGE c
>>>>>>  STRICT
>>>>>> AS '$libdir/pgpool-recovery', $function$pgpool_recovery$function$
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 11/12/14, 10:00 PM, Tatsuo Ishii wrote:
>>>>>>> Not sure why you reached the conclusion because the log stated that
>>>>>>> pgpool tried to execute the first stage command but failed...
>>>>>>>
>>>>>>> Maybe you misunderstand the concept of the recovery 1st stage command?
>>>>>>>
>>>>>>> 1) pgpol sends query to master "SELECT pgpool_recovery(..."
>>>>>>>
>>>>>>> 2) master executes the SELECT command.
>>>>>>>
>>>>>>> 3) function pgpool_recovery is called on the master
>>>>>>>
>>>>>>> 4) pgpool_recovery() tries to execute specified command
>>>>>>>    ("pgpool_basebackup" in your case)
>>>>>>>
>>>>>>> I suggest to look into PostgreSQL log on the master.
>>>>>>>
>>>>>>> Best regards,
>>>>>>> --
>>>>>>> Tatsuo Ishii
>>>>>>> SRA OSS, Inc. Japan
>>>>>>> English: http://www.sraoss.co.jp/index_en.php
>>>>>>> Japanese:http://www.sraoss.co.jp
>>>>>>>
>>>>>>>> Hello
>>>>>>>>
>>>>>>>>
>>>>>>>> I'm testing pgpool and it appears that pgpool never actually calls the
>>>>>>>> first stage script.
>>>>>>>>
>>>>>>>> I've added logging to the first stage script and it never logs that it
>>>>>>>> has been called.
>>>>>>>>
>>>>>>>> Any ideas?
>>>>>>>>
>>>>>>>> pgpool-II-3.4.0
>>>>>>>> openSUSE 13.2 (x86_64)
>>>>>>>> postgresql-server-9.3-3.1.2.noarch
>>>>>>>>
>>>>>>>>
>>>>>>>> This is the error I get from pcp_reconvery_node:
>>>>>>>>
>>>>>>>> DEBUG: send: tos="R", len=44
>>>>>>>> DEBUG: recv: tos="r", len=21, data=AuthenticationOK
>>>>>>>> DEBUG: send: tos="D", len=6
>>>>>>>> DEBUG: recv: tos="e", len=20, data=recovery failed
>>>>>>>> DEBUG: command failed. reason=recovery failed
>>>>>>>> BackendError
>>>>>>>> DEBUG: send: tos="X", len=4
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> And strace pgpool -nD returns this:
>>>>>>>>
>>>>>>>> 14-11-12 21:43:36: pid 21023: LOG:  starting recovering node 1
>>>>>>>> 2014-11-12 21:43:36: pid 21023: LOG:  executing recovery
>>>>>>>> 2014-11-12 21:43:36: pid 21023: DETAIL:  starting recovery command:
>>>>>>>> "SELECT pgpool_recovery('pgpool_basebackup', '10.0.51.62',
>>>>>>>> '/var/lib/pgsql/data', '5432')"
>>>>>>>> 2014-11-12 21:43:36: pid 21023: LOG:  executing recovery
>>>>>>>> 2014-11-12 21:43:36: pid 21023: DETAIL:  disabling statement_timeout
>>>>>>>> 2014-11-12 21:43:36: pid 21023: ERROR:  executing recovery, execution of
>>>>>>>> command failed at "1st stage"
>>>>>>>> 2014-11-12 21:43:36: pid 21023: DETAIL:  command:"pgpool_basebackup"
>>>>>>>> ) = ? ERESTARTNOHAND (To be restarted if no handler)
>>>>>>>> --- SIGUSR2 {si_signo=SIGUSR2, si_code=SI_USER, si_pid=21023, si_uid=0} ---
>>>>>>>> rt_sigprocmask(SIG_SETMASK, ~[ILL TRAP ABRT BUS FPE SEGV CONT SYS RTMIN
>>>>>>>> RT_1], NULL, 8) = 0
>>>>>>>> write(8, "\0", 1)                       = 1
>>>>>>>> rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
>>>>>>>> rt_sigreturn()                          = -1 EINTR (Interrupted system call)
>>>>>>>> rt_sigprocmask(SIG_SETMASK, ~[ILL TRAP ABRT BUS FPE SEGV CONT SYS RTMIN
>>>>>>>> RT_1], NULL, 8) = 0
>>>>>>>> rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
>>>>>>>> gettimeofday({1415846616, 459894}, NULL) = 0
>>>>>>>> select(8, [7], NULL, NULL, {84, 116932}) = 1 (in [7], left {84, 116930})
>>>>>>>> read(7, "\0", 1)                        = 1
>>>>>>>> rt_sigprocmask(SIG_SETMASK, ~[ILL TRAP ABRT BUS FPE SEGV CONT SYS RTMIN
>>>>>>>> RT_1], NULL, 8) = 0
>>>>>>>> kill(20928, SIGUSR2)                    = 0
>>>>>>>> kill(20929, SIGUSR2)                    = 0
>>>>>>>> ...
>>>>>>>> rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
>>>>>>>> gettimeofday({1415846616, 474081}, NULL) = 0
>>>>>>>> select(8, [7], NULL, NULL, {84, 102745}
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> pgpool-general mailing list
>>>>>>>> pgpool-general at pgpool.net
>>>>>>>> http://www.pgpool.net/mailman/listinfo/pgpool-general


More information about the pgpool-general mailing list