recovery_target_action = shutdown not working on PG11 during PITR restore

From: Maher Beg <maher(at)render(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: recovery_target_action = shutdown not working on PG11 during PITR restore
Date: 2023-06-28 22:12:36
Message-ID: CAHn9sCVZM1Y+MAVJQxmDbBNYTYaiTHkcf6NH14CpA49yqexvsA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello!

I'm attempting to restore a database (via pgbackrest) on PG11.20 and have
the database shutdown when all of the WAL archives have finished applying.
In my recovery.conf file I have recovery_target_action = 'shutdown' with an
appropriate recovery target time and restore command setup. hot_standby is
set to on.

When Postgres starts up it shows the correct recovery parameters in the
debug logs but after restoring and applying all the WAL archives ends up
promoting itself and has exited recovery mode (confirmed via psql select
pg_is_in_recovery()). I also see recovery.conf is renamed to recovery.done

I've tried changing the target action to pause and that still results in
promotion, as well as setting it to something invalid which causes Postgres
to correctly crash. It appears to be parsing correctly, but maybe I'm
missing an additional configuration or startup parameter to have PG11
restore and shutdown correctly. I've also tried hot_standby on and off, as
well as messing with standby_mode.

This same process with slight tweaks works just fine for PG12-PG15. Is
there anything else I should be checking or testing?

-Maher

Browse pgsql-general by date

  From Date Subject
Next Message Atul Kumar 2023-06-29 00:45:15 Wrong passwords allowed
Previous Message Laurenz Albe 2023-06-28 20:46:14 Re: need explanation about an explain plan