From: Tom Lane <tgl@sss.pgh.pa.us>
To: Олег Самойлов <splarv@ya.ru>
Cc: PostgreSQL mailing lists <pgsql-general@postgresql.org>
Subject: Re: PostgreSQL lock file
Date: Fri, 09 Aug 2019 10:31:56 -0400
Message-ID: <4820.1565361116@sss.pgh.pa.us> (raw)
In-Reply-To: <3E45AB93-A701-485D-9E46-44EEB7D04662@ya.ru>
References: <3E45AB93-A701-485D-9E46-44EEB7D04662@ya.ru>
=?utf-8?B?0J7Qu9C10LMg0KHQsNC80L7QudC70L7Qsg==?= <splarv@ya.ru> writes:
> I have a task to create HA PostgreSQL cross datacenter cluster. I created a test bed on VirtualBox and I simulate different failures and disastrous in loops. And got one of funny bug of the Postgresql (11.4). One of the clusters has two instances of PostgreSQL on port 5433 and 5434. After simulating unexpected power off of the node the lock files of PostgreSQL still exist in /tmp directory. And on recovery the first instance on port 5433 starts without problem, but the second instance sometimes not. The reason is that the PID in /tmp/.s.PGSQL.5434.lock sometimes point to the one of process of PostgereSQL on port 5433, for instance the logger.
Best practice for this sort of thing is considered to be to run the two
Postgres instances under different user IDs. That avoids them thinking
that the other one's lock files are relevant, and it provides an extra
layer of security against possible conflicts between the two instances.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, splarv@ya.ru
Subject: Re: PostgreSQL lock file
In-Reply-To: <4820.1565361116@sss.pgh.pa.us>
References: <3E45AB93-A701-485D-9E46-44EEB7D04662@ya.ru> <4820.1565361116@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox