Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZNOMZ-0007eq-1E for pgsql-admin@arkaria.postgresql.org; Thu, 06 Aug 2015 16:49:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZNOMY-0007ym-JU for pgsql-admin@arkaria.postgresql.org; Thu, 06 Aug 2015 16:49:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZNOMW-0007yO-LR for pgsql-admin@postgresql.org; Thu, 06 Aug 2015 16:49:50 +0000 Received: from nm30-vm1.bullet.mail.gq1.yahoo.com ([98.136.216.192]) by makus.postgresql.org with esmtps (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZNOMS-0003RL-ME for pgsql-admin@postgresql.org; Thu, 06 Aug 2015 16:49:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1438879782; bh=oCpsIti8KH6iT1p6xklvyDjbPolU7s0lw5fBVG8EbJQ=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=JWGb8qAg7jR0dDcansyRlzrkPnByiwEvWhKu0T9UW+zW3m065fkS/3i7kdTtXJc8FvaYkFOT84wxNyGxoiaV/Cphx44xu0bVJQ2rBGr8MvD9CcIFExDU067idPC7ZWm57QBNUq80yEb6BJCGhmua9lxXeRHDjGtscIGkKbsoDYh0GoHCMV2q9wbrMh8Zd6K7JGefnYEjvqlPmYWR6vZv2EKokPxflbcXbRQybZZSClujppohcaTD0AmB9pWbIJuNhPIc7BnhCLrNCbGlc0kfJpAD9oBBY5+OZA7HK26yzyEZuj6U4HqCuvEk7zdO+XRwHap/bW3faAptDOCJxouhrg== Received: from [98.137.12.60] by nm30.bullet.mail.gq1.yahoo.com with NNFMP; 06 Aug 2015 16:49:42 -0000 Received: from [98.137.12.222] by tm5.bullet.mail.gq1.yahoo.com with NNFMP; 06 Aug 2015 16:49:42 -0000 Received: from [127.0.0.1] by omp1030.mail.gq1.yahoo.com with NNFMP; 06 Aug 2015 16:49:42 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 257238.35394.bm@omp1030.mail.gq1.yahoo.com X-YMail-OSG: AkyW7hgVM1moj.bVKU1gE.RuJM2_zHACTpTa4gMHoDx0WozJaBl7t8Tq7q.DhzT vvokmE76FR4kK6htW2q4k2oaG6iw.P8h6tnj1IUtA3WGSgACZ873aGZxa.lcgk1zesIiwio3nGA2 zam5UbMwyzZ0d9iyPa1vFMOPwpcIfa1dsWepszTr2fLnLpXZADBPSHF51SQ10YfEHJBZ0LANO91E dyGv2uGa0KGUdTzsC8mK89K3LjgM.TXI3erSEPweG4cnbt6g7SbAiQOfCB6i8vlqJkL_PXU0FzUO Nh9JdbYQRTEgFDl7q8h2gigF4GOyAZYg2WpUu5L.FFDsCkBG0AVI9pP2pUSVyBIfYMRfOPGIoljH p9GJguURduvp2f1y227Ez7iJEkvrxRH9pcH7lrR8XjurOJ1SAeQwuMtxJ.5Y6SC4ZI.946OuKZJH 0quAJtJIPbPAJAt3qg2L2gIb0IZ8Xbmg_MD6bwTxeiqfGuDRxfYrtgtb_9PP5PQGa Received: by 216.39.60.199; Thu, 06 Aug 2015 16:49:41 +0000 Date: Thu, 6 Aug 2015 16:49:36 +0000 (UTC) From: Kevin Grittner Reply-To: Kevin Grittner To: John Scalia , "pgsql-admin@postgresql.org" Message-ID: <2095928829.121339.1438879776368.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: References: Subject: Re: pg_basebackup problem... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Length: 1810 X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org John Scalia wrote: > I've been examining the source code to pg_basebackup written by > Magnus Hagander. It definitely shows that if you do not issue a > "-X f" or "-X s" then the pg_xlogs will NOT be included in the > backup. This leads me to a couple more questions: > > 1) Does anyone know why anything in a WAL segment is required for > a database to start? Yes. This is covered in the docs, but in summary: the files could be modified during the copy, and without WAL replay from before the copy started the database would not necessarily be consistent. > I ask this as the backup_label generated by pg_basebackup > indicates a segment where the latest checkpoint is contained. It indicates the location of the last checkpoint before the start of the backup -- the latest point from which you cab start WAL replay to achieve a consistent database. > Surely, there has to be some better way to permit the DB to > sanely initialize. A write-ahead log is a well-known and widely used technique for this. What would you suggest instead? > 2) If a WAL segment is in fact required for the backed up DB to > start, why would pg_basebackup not include those by default? To > not do so, doesn't create a backup file, just in this case, a > tarball that's worthless. ... unless you are archiving the WAL to somewhere that it will be kept long enough to be usable for such purposes. If you are (and I highly recommend that you do so), including WAL in the base backup is a waste of both bandwidth and storage space. Besides reviewing the documentation's discussions of WAL and backups, you might want to read this: http://tbeitr.blogspot.com/2015/07/deleting-backuplabel-on-restore-will.html -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin