Add a hint when postgresql.conf hot_standby = 'off' and recovery.conf standby = 'on'

From: Matthew Kelly <mkelly(at)tripadvisor(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Add a hint when postgresql.conf hot_standby = 'off' and recovery.conf standby = 'on'
Date: 2015-05-22 03:53:32
Message-ID: A82B3105-B67E-4625-8AB8-4998C688EFFA@tripadvisor.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2015-05-22 04:55:40 Re: Strange replication problem - segment restored from archive but still requested from master
Previous Message Alvaro Herrera 2015-05-22 03:47:55 Re: broken documentation: BackgroundWorkerInitializeConnection(NULL, NULL);