Re: Online base backup from the hot-standby

From: Jun Ishiduka <ishizuka(dot)jun(at)po(dot)ntts(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Cc: ssinger_pg(at)sympatico(dot)ca, cedric(dot)villemain(dot)debian(at)gmail(dot)com, robertmhaas(at)gmail(dot)com, masao(dot)fujii(at)gmail(dot)com, magnus(at)hagander(dot)net, heikki(dot)linnakangas(at)enterprisedb(dot)com
Subject: Re: Online base backup from the hot-standby
Date: 2011-09-13 06:50:28
Message-ID: 201109130651.p8D6pP7Z003656@ccmds32.silk.ntts.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Update patch.

Changes:
* set 'on' full_page_writes by user (in document)
* read "FROM: XX" in backup_label (in xlog.c)
* check status when pg_stop_backup is executed (in xlog.c)

> Hi, Created a patch in response to comments.
>
>
> * Procedure
> 1. Call pg_start_backup('x') on hot standby.
> 2. Take a backup of the data dir.
> 3. Copy the control file on hot standby to the backup.
> 4. Call pg_stop_backup() on hot standby.
>
>
> * Behavior
> (take backup)
> If we execute pg_start_backup() on hot standby then execute restartpoint,
> write a strings as "FROM: slave" in backup_label and change backup mode,
> but do not change full_page_writes into "on" forcibly.
>
> If we execute pg_stop_backup() on hot standby then rename backup_label
> and change backup mode, but neither write backup end record and history
> file nor wait to complete the WAL archiving.
> pg_stop_backup() is returned this MinRecoveryPoint as result.
>
> If we execute pg_stop_backup() on the server promoted then error
> message is output since read the backup_label.
>
> (recovery)
> If we recover with the backup taken on hot standby, MinRecoveryPoint in
> the control file copied by 3 of above-procedure is used instead of backup
> end record.
>
> If recovery starts as first, BackupEndPoint in the control file is written
> a same value as MinRecoveryPoint. This is for remembering the value of
> MinRecoveryPoint during recovery.
>
> HINT message("If this has ...") is always output when we recover with the
> backup taken on hot standby.
>
>
> * Problem
> full_page_writes's problem.
> > This has the following two problems.
> > * pg_start_backup() must set 'on' to full_page_writes of the master that
> > is actual writing of the WAL, but not the standby.
> > * The standby doesn't need to connect to the master that's actual writing
> > WAL.
> > (Ex. Standby2 in Cascade Replication: Master - Standby1 - Standby2)
> >
> > I'm worried how I should clear these problems.
>
> Status: Considering
> (Latest: http://archives.postgresql.org/pgsql-hackers/2011-08/msg00880.php)
>
>
> Regards.
>
>
> --------------------------------------------
> Jun Ishizuka
> NTT Software Corporation
> TEL:045-317-7018
> E-Mail: ishizuka(dot)jun(at)po(dot)ntts(dot)co(dot)jp
> --------------------------------------------

--------------------------------------------
Jun Ishizuka
NTT Software Corporation
TEL:045-317-7018
E-Mail: ishizuka(dot)jun(at)po(dot)ntts(dot)co(dot)jp
--------------------------------------------

Attachment Content-Type Size
standby_online_backup_07.patch application/octet-stream 27.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Banafato 2011-09-13 08:18:48 Rough impl of IGNORE NULLS for window functions
Previous Message Fujii Masao 2011-09-13 05:46:17 Re: unite recovery.conf and postgresql.conf