21.08.2024 13:00, Alexander Lakhin wrote:
As a recent failure, produced by drongo [1], shows, pg_ctl stop/start
sequence may break on Windows due to the transient DELETE PENDING state of
posmaster.pid.


lorikeet didn't lose it's chance to add two cents to the conversation and
failed on "pg_ctl stop" [1]:
waiting for server to shut down........pg_ctl: could not open PID file 
"data-C/postmaster.pid": Permission denied

I find it less interesting, because Cygwin-targeted code doesn't try to
handle the DELETE PENDING state at all.

I've made a simple test (see attached), which merely executes stop/start
in a loop, and observed that running 10 test jobs in parallel is enough to
get:
### Stopping node "node" using mode fast
# Running: pg_ctl -D .../tmp_check/t_099_pg_ctl_stop+start_node_data/pgdata -m 
fast stop
waiting for server to shut down....pg_ctl: could not open PID file ".../tmp_check/t_099_pg_ctl_stop+start_node_data/pgdata/postmaster.pid": Permission denied
# pg_ctl stop failed: 256

or
# Running: pg_ctl -D .../tmp_check/t_099_pg_ctl_stop+start_node_data/pgdata -m 
fast stop
waiting for server to shut down....pg_ctl: could not open PID file ".../tmp_check/t_099_pg_ctl_stop+start_node_data/pgdata/postmaster.pid": Device or resource busy
# pg_ctl stop failed: 256

[1] 
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=lorikeet&dt=2024-08-22%2009%3A52%3A46

Best regards,
Alexander

Attachment: 099_pg_ctl_stop+start.pl
Description: Perl program

Reply via email to