Re: BUG #15589: Due to missing wal, restore ends prematurely andopens database for read/write
От | leif@lako.no |
---|---|
Тема | Re: BUG #15589: Due to missing wal, restore ends prematurely andopens database for read/write |
Дата | |
Msg-id | d8b925764876064175d94447e698ec69@lako.no обсуждение исходный текст |
Ответ на | Re: BUG #15589: Due to missing wal, restore ends prematurely andopens database for read/write (Jeff Janes <jeff.janes@gmail.com>) |
Список | pgsql-bugs |
"Jeff Janes" <jeff.janes@gmail.com> skrev 11. januar 2019 kl. 15:03:
The documentation for recovery.conf states that with recovery_target_time setOn Fri, Jan 11, 2019 at 4:08 AM PG Bug reporting form <noreply@postgresql.org> wrote:
PostgreSQL should have paused recovery also on the first scenario. Then I
could have added missing wal and continued with restore.At the least, I think we should log an explicit WARNING if the WAL stream ends before the specified PIT is reached.
recovery_target_action
defaults to pause.Even if stop point is not reached, pause should be activated.
After checking the source this might be solved with a small addition in StartupXLOG.c
Someone with more experience with the source code should check this out.
if (reachedStopPoint)
{
if (!reachedConsistency)
ereport(FATAL,
(errmsg("requested recovery stop point is before consistent recovery point")));
/*
* This is the last point where we can restart recovery with a
* new recovery target, if we shutdown and begin again. After
* this, Resource Managers may choose to do permanent
* corrective actions at end of recovery.
*/
switch (recoveryTargetAction)
{
case RECOVERY_TARGET_ACTION_SHUTDOWN:
/*
* exit with special return code to request shutdown
* of postmaster. Log messages issued from
* postmaster.
*/
proc_exit(3);
case RECOVERY_TARGET_ACTION_PAUSE:
SetRecoveryPause(true);
recoveryPausesHere();
/* drop into promote */
case RECOVERY_TARGET_ACTION_PROMOTE:
break;
}
/* Add these lines .... */
} else if (recoveryTarget == RECOVERY_TARGET_TIME)
{
/*
* Stop point not reached but next WAL could not be read
* Some explanation and warning should be logged
*/
switch (recoveryTargetAction)
{
case RECOVERY_TARGET_ACTION_PAUSE:
SetRecoveryPause(true);
recoveryPausesHere();
break;
}
}
/* .... until here */
--
Leif
В списке pgsql-bugs по дате отправления: