PostgreSQL – Fix ‘pg_ctl: Server Did Not Promote in Time’ Error

postgresql

I setup a two node postgresql 10 cluster to test replication. Following this guide

I was able to get replication running correctly. However, I want to test the process of the slave to master. When I stop the master node, and run pg_ctl promote -D on the slave, I get:

pg_ctl: server did not promote in time

I've looked online and can't find anything related to being unable to promote in time. After running the command and receiving the error, I have to manually start postgresql and it is still running in a read only state.

Postgresql is running on Ubuntu 18.04.

Best Answer

To promote, pg_ctl writes a file called $PGDATA/promote, sends SIGUSR1, then waits a default of 60 seconds for the server to acknowledge that it is now read-write. Does that file exist? What is in the server log file?