Re: PostgreSQL lock file - Mailing list pgsql-general

From Tom Lane
Subject Re: PostgreSQL lock file
Date
Msg-id 4820.1565361116@sss.pgh.pa.us
Whole thread Raw
In response to PostgreSQL lock file  (Олег Самойлов <splarv@ya.ru>)
Responses Re: PostgreSQL lock file  (Олег Самойлов <splarv@ya.ru>)
List pgsql-general
=?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
differentfailures and disastrous in loops. And got one of funny bug of the Postgresql (11.4). One of the clusters has
twoinstances of PostgreSQL on port 5433 and 5434. After simulating unexpected power off of the node the lock files of
PostgreSQLstill exist in /tmp directory. And on recovery the first instance on port 5433 starts without problem, but
thesecond instance sometimes not. The reason is that the PID in /tmp/.s.PGSQL.5434.lock sometimes point to the one of
processof 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



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: PostgreSQL 8.4 Tablespace Inconsistency
Next
From: Adrian Klaver
Date:
Subject: Re: Generate test data inserts - 1GB