Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A7B8C133616B for ; Mon, 11 Apr 2011 12:48:41 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 26211-08 for ; Mon, 11 Apr 2011 15:48:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 9C6C91337B54 for ; Mon, 11 Apr 2011 12:47:20 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Mon, 11 Apr 2011 10:47:18 -0500 Message-Id: <4DA2DC30020000250003C644@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Mon, 11 Apr 2011 10:47:12 -0500 From: "Kevin Grittner" To: "Ian Lea" , "David Roland" Cc: Subject: Re: pg_start_backup - backups References: <1302200280041-4289135.post@n5.nabble.com> <7E0E9F0DF4C17A40BE6F616E6492B4D353E507@ExchangeVM.DOCS.COM> In-Reply-To: <7E0E9F0DF4C17A40BE6F616E6492B4D353E507@ExchangeVM.DOCS.COM> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/82 X-Sequence-Number: 37263 "David Roland" wrote: > changes to the data folder continue even after the PG_START_BACKUP > command has been issued. This implies to me that the contents of > any copy of the data folder may be unreliable. i.e. the copy may > not reflect the state of the data folder either before the copy > started or after the copy has finished. It may reflect the state > of the data folder in some transient form. Right. > Assuming this is true, is the copy still usable for restoration? Yes. > If so, how does PostgreSQL get the data folder to a stable > state? Is it by the use of the WAL files that may be created > during the backup process and the restore.config file? Exactly. Simplifying somewhat: - The pg_start_backup causes the WAL position to be remembered. You will need to start WAL replay at this point. - Every significant change to a page is WAL-logged. - Changes after you record the restart point may or may not be in the base backup. - After the base backup copying is complete, pg_stop_backup records the WAL position. You will need to replay WAL *at least* to this point to have a consistent database. - WAL replay will bring every page modified after the "start" to a valid state, whether or not any or all direct modifications to that page made it into the base backup. - This actually goes beyond page fix-ups to file creation and deletion, etc. -Kevin