Re: Allowing multiple concurrent base backups - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Allowing multiple concurrent base backups
Date
Msg-id 1294777003.25206.5.camel@jdavis-ux.asterdata.local
Whole thread Raw
In response to Allowing multiple concurrent base backups  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Allowing multiple concurrent base backups  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On Tue, 2011-01-11 at 20:17 +0200, Heikki Linnakangas wrote:
> So, this patch modifies the internal do_pg_start/stop_backup functions 
> so that in addition to the traditional mode of operation, where a 
> backup_label file is created in the data directory where it's backed up 
> along with all other files, the backup label file is be returned to the 
> caller, and the caller is responsible for including it in the backup. 
> The code in replication/basebackup.c includes it in the tar file that's 
> streamed the client, as "backup_label".

Perhaps we can use this more intelligent form of base backup to
differentiate between:a. a primary that has crashed while a backup was in progress; andb. an online backup that is
beingrestored.
 

Allowing the user to do an unrestricted file copy as a base backup
doesn't allow us to make that differentiation. That lead to the two bugs
that we fixed in StartupXLOG(). And right now there are still two
problems remaining (albeit less severe):
1. If it's a primary recovering from a crash, and there is a
backup_label file, and the WAL referenced in the backup_label exists,
then it does a bunch of extra work during recovery; and2. In the same situation, if the WAL referenced in the
backup_label
does not exist, then it PANICs with a HINT to tell you to remove the
backup_label.

Is this an opportunity to solve these problems and simplify the code?

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Allowing multiple concurrent base backups
Next
From: Jan Urbański
Date:
Subject: Re: autogenerating error code lists (was Re: [COMMITTERS] pgsql: Add foreign data wrapper error code values for SQL/MED.)