agora inbox for pgsql-bugs@postgresql.org
help / color / mirror / Atom feedFrom: Álvaro Herrera <alvherre@kurilemu.de>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: scherbakov_lo_radarmms@mail.ru
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19610: Database won't start if an unrelated process is exist
Date: Wed, 12 Aug 2026 13:26:14 +0200
Message-ID: <ansmw5aeWQikOu2k@alvherre.pgsql> (raw)
In-Reply-To: <BF47A8F0-A523-44F3-A411-5228964C1BA8@yesql.se>
On 2026-Aug-07, Daniel Gustafsson wrote:
> > Steps:
> > 1. start Postgress database
> > 2. hard reboot system by
> > sudo sh -c "echo b > /proc/sysrq-trigger"
> > 3. wait for system boot up.
> > 4. get a PID-number from the the first line of postmaster.pid
> > 5. create ANY process that have PID that same as PID-number
> > 6. start Postgress database
> > 7. The database will not start
> >
> > If skip step 5 then database starts successfully.
>
> This is not a bug, it is the intended behaviour, a process with the PID from
> the .pid file which is owned by the same userid is reported this way.
Well, I'm not sure this is really intended. I'd say it's rather
emergent behavior from what we can do, which is to inquiry whether a
process with that PID exist or not; and if it does, we assume it's the
postmaster and give up. But maybe there are ways to verify whether it's
really a postmaster that indeed corresponds to that .pid file; so that
if we can determine it's not, then the .pid file is stale and we can
remove it and move on.
I guess the problem is figuring out what sort of (extremely reliable)
test we can make to verify whether a process is a postmaster or not.
If we get it wrong, the user ends up with corrupt data which definitely
is not nice.
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
view thread (2+ messages) latest in thread
Message-ID: <ansmw5aeWQikOu2k@alvherre.pgsql>
Permalink: ../ansmw5aeWQikOu2k@alvherre.pgsql/
Also on: postgresql.org/message-id/ansmw5aeWQikOu2k@alvherre.pgsql
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: alvherre@kurilemu.de, daniel@yesql.se, scherbakov_lo_radarmms@mail.ru, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19610: Database won't start if an unrelated process is exist
In-Reply-To: <ansmw5aeWQikOu2k@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox