Re: unable to fail over to warm standby server

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Mason Hale <mason(at)onespot(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org, Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: Re: unable to fail over to warm standby server
Date: 2010-01-29 20:32:47
Message-ID: 4B6345EF.1080402@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Actually, I think there's a tiny harmless bug in the server too. When it
prints the error message:

2010-01-18 21:08:31 UTC ()FATAL: could not restore file
"0000000200003C82000000D8" from archive: return code 65280

That return code is not the return code that came from the
restore_command. Ie if you do exit(200) in the command, you won't see
"return code 200", but you see the return value from system(). system()
doesn't return the exit code directly, but an encoded integer that
includes the exit code. You're supposed to call WEXITSTATUS() on it to
get the real return code.

That only affects the error message and is harmless otherwise, but I
thought I'd mention it. I'll fix it, unless someone wants to argue that
its more useful to print the raw return value of system(), because it
might contain more information like which signal killed the process,
that you could extract from the cryptic error code using e.g WTERMSIG()
macro.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message D Black 2010-01-29 20:48:43 BUG #5303: Upgrade failure due to sever.key permissions
Previous Message Tom Lane 2010-01-29 20:26:02 Re: BUG #5302: WIN1252 encoding causes server memory leak