Re: BUG #15589: Due to missing wal, restore ends prematurely and opens database for read/write

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: leif(at)lako(dot)no, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15589: Due to missing wal, restore ends prematurely and opens database for read/write
Date: 2019-02-26 08:12:55
Message-ID: 20190226081255.GK27822@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Thu, Jan 31, 2019 at 09:26:48PM +0900, Kyotaro HORIGUCHI wrote:
> I don't think no one expected that server follows
> recovery_target_action without setting a target, so we can change
> the behavior when any kind of target is specified. So I propose
> to follow recovery_target_action even if not rached the target
> when any recovery target isspecified.

Quoting the docs:
https://www.postgresql.org/docs/current/recovery-target-settings.html
recovery_target_action (enum)
"Specifies what action the server should take once the recovery target
is *reached*."

So what we have now is that an action would be taken iff a stop point
is defined and reached. What this patch changes is that the action
would be taken even if the stop point has *not* been reached once the
end of a WAL stream is found.

+ * to be taken regardless whether the target is reached or not .
Nit 1: Dot at the end has an extra space.

Nit 2: s/specfied/specified/

Please do not take me wrong, I can see that there could be use cases
where it is possible to take an action at the end of a WAL stream if
there is less WAL than what was planned, perhaps if the OP has set
an incorrect stop position too far in the future, still too much WAL
would have been replayed so it would make the base backup unusable for
future uses. Also, it looks incorrect to me to change an existing
behavior and to use the same semantics for triggering an action if a
stop point is defined and reached.
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Prakash Ramakrishnan 2019-02-26 10:06:35 Re: BUG #15648: oracle_fdw extension not able to create
Previous Message Michael Paquier 2019-02-26 04:38:37 Re: BUG #15654: COPY command not working for 2gb CSV files

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2019-02-26 08:13:49 Re: Segfault when restoring -Fd dump on current HEAD
Previous Message Masahiko Sawada 2019-02-26 07:56:37 Re: reloption to prevent VACUUM from truncating empty pages at the end of relation