=?utf-8?B?0J7Qu9C10LMg0KHQsNC80L7QudC70L7Qsg==?= <splarv@xxxxx> 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