1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Have pg_rewind run crash recovery before rewinding

If we don't do this, the rewind fails if the server wasn't cleanly shut
down, which seems unhelpful serving no purpose.

Also provide a new option --no-ensure-shutdown to suppress this
behavior, for alleged advanced usage that prefers to avoid the crash
recovery.

Authors: Paul Guo, Jimmy Yih, Ashwin Agrawal
Reviewed-by: Álvaro Herrera
Discussion: https://postgr.es/m/CAEET0ZEffUkXc48pg2iqARQgGRYDiiVxDu+yYek_bTwJF+q=Uw@mail.gmail.com
This commit is contained in:
Alvaro Herrera
2019-09-27 16:40:01 -03:00
parent c967e13f40
commit 5adafaf176
2 changed files with 95 additions and 0 deletions

View File

@ -165,6 +165,21 @@ PostgreSQL documentation
</listitem>
</varlistentry>
<varlistentry>
<term><option>--no-ensure-shutdown</option></term>
<listitem>
<para>
<application>pg_rewind</application> verifies that the target server
is cleanly shutdown before rewinding; by default, if it isn't, it
starts the server in single-user mode to complete crash recovery.
By passing this option, <application>pg_rewind</application> skips
this and errors out immediately if the server is not cleanly shut
down. Users are expected to handle the situation themselves in that
case.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-n</option></term>
<term><option>--dry-run</option></term>