Re: Online base backup from the hot-standby

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Jun Ishiduka <ishizuka(dot)jun(at)po(dot)ntts(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org, magnus(at)hagander(dot)net, heikki(dot)linnakangas(at)enterprisedb(dot)com, ssinger_pg(at)sympatico(dot)ca
Subject: Re: Online base backup from the hot-standby
Date: 2011-08-18 02:12:55
Message-ID: CAHGQGwGM_sYnaPb56QzZ5AUHQRdm5hujXcp-na5UgqRqpYkpqA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2011/8/5 Jun Ishiduka <ishizuka(dot)jun(at)po(dot)ntts(dot)co(dot)jp>:
> * Procedure
>
> 1. Call pg_start_backup('x') on the standby.
> 2. Take a backup of the data dir.
> 3. Call pg_stop_backup() on the standby.
> 4. Copy the control file on the standby to the backup.
> 5. Check whether the control file is status during hot standby with pg_controldata.
>   -> If the standby promote between 3. and 4., the backup can not recovery.
>      -> pg_control is that "Minimum recovery ending location" is equals 0/0.
>      -> backup-end record is not written.

What if we do #4 before #3? The backup gets corrupted? My guess is
that the backup is still valid even if we copy pg_control before executing
pg_stop_backup(). Which would not require #5 because if the standby
promotion happens before pg_stop_backup(), pg_stop_backup() can
detect that status change and cancel the backup.

#5 looks fragile. If we can get rid of it, the procedure becomes more
robust, I think.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeevan Chalke 2011-08-18 04:47:41 Re: Allowing same cursor name in nested levels
Previous Message Fujii Masao 2011-08-18 01:43:21 Re: Online base backup from the hot-standby