Add a hint when postgresql.conf hot_standby = 'off' and recovery.conf standby = 'on' - Mailing list pgsql-hackers

From Matthew Kelly
Subject Add a hint when postgresql.conf hot_standby = 'off' and recovery.conf standby = 'on'
Date
Msg-id A82B3105-B67E-4625-8AB8-4998C688EFFA@tripadvisor.com
Whole thread Raw
Responses Re: Add a hint when postgresql.conf hot_standby = 'off' and recovery.conf standby = 'on'
List pgsql-hackers
If you do the following sequence, the server gives the least helpful error message:

----
initdb data
pg_ctl -D data -l logfile start

# The following reconfigs are obvious based on error message if you try to take a base backup
echo 'local  replication  all  trust’ >> data/pg_hba.conf
sed -i 's/#wal_level = minimal/wal_level = hot_standby/' data/postgresql.conf
sed -i 's/#max_wal_senders = 0/max_wal_senders = 5/' data/postgresql.conf

# Backup and start
pg_basebackup -D data_5434 -R
pg_ctl -D data_5434 -l logfile_5434 -o ‘-p 5434’ start

# Attempt psql
psql -p 5434
> psql: FATAL:  the database system is starting up
----
It doesn’t matter what log level you put the server log in either, it providers no additional helpful information.

The problem of course is that:
postgresql.conf: hot_standby = ‘off'
recovery.conf: standby = ‘on'

Why anybody in practice would want hot_standby off while in standby mode eludes me, but these are our default values (recovery.conf was generated by pg_basebackup -R).

It seems worth adding a hint and/or changing the error message to be more descriptive when in this state.  Any options about what should be logged before I start putting together a patch?

- Matt K

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: broken documentation: BackgroundWorkerInitializeConnection(NULL, NULL);
Next
From: Fujii Masao
Date:
Subject: Re: [GENERAL] Strange replication problem - segment restored from archive but still requested from master