Re: Recovery to backup point

From: "MauMau" <maumau307(at)gmail(dot)com>
To: "Heikki Linnakangas" <hlinnakangas(at)vmware(dot)com>
Cc: "Michael Paquier" <michael(dot)paquier(at)gmail(dot)com>, "PostgreSQL mailing lists" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Recovery to backup point
Date: 2013-12-09 13:05:38
Message-ID: 041D036C52454A5296896728D35B0537@maumau
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: "Heikki Linnakangas" <hlinnakangas(at)vmware(dot)com>
> Thanks. Looks sane, although I don't much like the proposed interface to
> trigger this, setting recovery_target_time='backup_point'. What the code
> actually does is to stop recovery as soon as you reach consistency, which
> might not have anything to do with a backup. If you set it on a warm
> standby server, for example, it will end recovery as soon as it reaches
> consistency, but there was probably no backup taken at that point.

Thank you for reviewing so rapidly. I thought I would check the end of
backup in recoveryStopsHere(), by matching XLOG_BACKUP_END and
ControlFile->backupStartPoint for backups taken on the primary, and
comparing the current redo location with ControlFile->backupEndPoint for
backups taken on the standby. However, that would duplicate much code in
XLOG_BACKUP_END redo processing and checkRecoveryConsistency(). Besides,
the code works only when the user explicitly requests recovery to backup
point, not when he starts the warm standby server. (I wonder I'm answering
correctly.)

> Hmm. I guess it's a nice work-around to use this option, but it doesn't
> really solve the underlying issue. The system might well reach consistency
> between deleting database files and the transaction commit, in which case
> you still have the same problem.

Yes, you're right. But I believe the trouble can be avoided most of the
time.

> It would be nice to have a more robust fix for that. Perhaps we could use
> the safe_restartpoint machinery we have to not allow recovery to end until
> we see the commit record. I was really hoping to get rid of that machinery
> in 9.4, though, as it won't be needed for GIN and B-tree after the patches
> I have in the current commitfest are committed.
>
> In any case, that's a separate discussion and separate patch.

I think so, too. That still seems a bit difficult for what I am now. If
someone starts a discussion in a separate thread, I'd like to join it.

Regards
MauMau

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Benedikt Grundmann 2013-12-09 13:33:02 How to do fast performance timing
Previous Message Euler Taveira 2013-12-09 13:03:42 JSON decoding plugin