Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wy5Xl-0002pl-Bi for pgsql-admin@arkaria.postgresql.org; Fri, 20 Jun 2014 20:36:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wy5Xk-0008FS-JO for pgsql-admin@arkaria.postgresql.org; Fri, 20 Jun 2014 20:36:16 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wy5Xj-0008FG-De for pgsql-admin@postgresql.org; Fri, 20 Jun 2014 20:36:15 +0000 Received: from nm17-vm3.bullet.mail.ne1.yahoo.com ([98.138.91.147]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Wy5Xf-0006fD-CJ for pgsql-admin@postgresql.org; Fri, 20 Jun 2014 20:36:13 +0000 Received: from [98.138.101.132] by nm17.bullet.mail.ne1.yahoo.com with NNFMP; 20 Jun 2014 20:36:09 -0000 Received: from [98.138.101.168] by tm20.bullet.mail.ne1.yahoo.com with NNFMP; 20 Jun 2014 20:36:09 -0000 Received: from [127.0.0.1] by omp1079.mail.ne1.yahoo.com with NNFMP; 20 Jun 2014 20:36:09 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 918623.6500.bm@omp1079.mail.ne1.yahoo.com Received: (qmail 22114 invoked by uid 60001); 20 Jun 2014 20:36:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1403296569; bh=tfinrSdeedx2+uz+cC3ACDUonazZfrR7oeA/LJp2bcE=; h=References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=A6sPe2zh8igPxz8tpSMziRDuyQEBNqbXbNdST2qPA6VK1TTWPIN+W8xRyR7ShYG/+uBB4T/uhPptJX3oFsUeLa8F33BLzwkBhdjzt+yql0bRGE8YAEmpez2mhzdjxpG4t9jb05v6NLexgVqwkGN7cLGzv0vQOfEnP6mDY3QV+Jc= X-YMail-OSG: 3a1rhncVM1nBbPeEK31ggOtZQijP7MT73haO4rhODcaATbY gZG_PaDS5g2ycKW9vYX78l_c7gg4urEkTu68DQmAIgFTBDhsLqQux8gK.Nls NLfJ5MwL0.EFloVgHvXruvf1A7xahoiFJlS5qTY.CbHsQU0w5ujzDYknYWbE Q8Xrb39BFJ9avQB8_D1MZHe.jp_2UlOPeaO_9gNqYdZ1LNCNTw8hi8hQtMlq 6XwX.UCPIOfxzmDyE5I4xGYNFnaAKHysTasZpR1N5OWp2VPWj9Z7uyWNXW38 O6spoBS.CBS.1o0DSiQFCpjDbQx._E4U_3yCj5HDKFoxCRiqC3PEJUy.IA2P O5iuhMrlnT9en8_E084QFjePN4kIvMdWdevztLDBGVMXMMmR13YNhX2CEPWq 6FABLXaW3JQ0V9vS7G5XH4aEkbHumQMXibQ1ljzwZLRq9oo2vcLEGAlJOLYM ih8QU7IilLQwVvqEYEePREkgeflM1fBGhnTZMXVOgpbQztEejMgUk76rQfaU jLcficiOooexV3Zs_uNPI7mTyrrWvYFBYfzZYxHC3Xltoe.dORgS4zvjR1f0 wlsnl.PTIhVR6EuVRo7V2mvjbF4MohoXuvf8qczhFrzCLSibxMCkaNVl904u 71TzhOJHklxbFywPWWZa2PGOj5gJKqM5JJdMQifVKxr21OqdjgIqDFbC143e uVeFJJ9q1agqVVvAaU.c4eBU1sP07IJ6omLYUZOj7Wtc- Received: from [24.178.25.147] by web122303.mail.ne1.yahoo.com via HTTP; Fri, 20 Jun 2014 13:36:09 PDT X-Rocket-MIMEInfo: 002.001, Sm9obiBTY2FsaWEgPGpheWtub3dzdW5peEBnbWFpbC5jb20.IHdyb3RlOgo.IE9uIDYvMjAvMjAxNCAyOjA5IFBNLCBLZXZpbiBHcml0dG5lciB3cm90ZToKCj4.IFRoZSBkb2N1bWVudGF0aW9uIGlzIHlvdXIgZnJpZW5kLsKgIEl0IGdpdmVzIHByZXR0eSBzcGVjaWZpYwo.PiBpbnN0cnVjdGlvbnMgZm9yIHdoYXQgdG8gZG8uCgo.IFdlbGwsIEkgZGlkIGZpbmFsbHkgZ2V0IGl0IHdvcmtpbmcgYnkgYWRkaW5nIC1YIHMgLWMgZmFzdCB0byB0aGUKPiBwZ19iYXNlYmFja3VwIGNvbW1hbmQuCgpIb3BlZnVsbHkBMAEBAQE- X-Mailer: YahooMailWebService/0.8.191.1 References: <53A47312.9040600@gmail.com> <1403287756.14509.YahooMailNeo@web122305.mail.ne1.yahoo.com> <53A484E8.2060200@gmail.com> Message-ID: <1403296569.12353.YahooMailNeo@web122303.mail.ne1.yahoo.com> Date: Fri, 20 Jun 2014 13:36:09 -0700 From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: Cannot rebuild a standby server To: John Scalia , "pgsql-admin@postgresql.org" In-Reply-To: <53A484E8.2060200@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) 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: > On 6/20/2014 2:09 PM, Kevin Grittner wrote: >> The documentation is your friend.=A0 It gives pretty specific >> instructions for what to do. > Well, I did finally get it working by adding -X s -c fast to the > pg_basebackup command. Hopefully you did not follow that with a copy of pg_xlog files from a running server. > Kevin, if I didn't copy WALs over, the database still refused to > start as it claimed it was looking for a one of the first > specific files. You absolutely need WAL files for recovery.=A0 You absolutely should not copy the files ad hoc from a running cluster, as they may be in flux at the time of the copy.=A0 The archive_command is called at the right point in time to get a good copy, and using the pg_basebackup command will also acquire them in a safe way. > Also, I've not seen any references to removing certain files like > a backup_label file in the standby's data directory causing > problems. On this page: http://www.postgresql.org/docs/current/static/continuous-archiving.html ... it says: | pg_start_backup creates a backup label file, called backup_label, | in the cluster directory with information about your backup, | including the start time and label string. The file is critical | to the integrity of the backup, should you need to restore from | it. The same page later says: | It's also worth noting that the pg_start_backup function makes a | file named backup_label in the database cluster directory, which | is removed by pg_stop_backup. This file will of course be | archived as a part of your backup dump file. The backup label | file includes the label string you gave to pg_start_backup, as | well as the time at which pg_start_backup was run, and the name | of the starting WAL file. In case of confusion it is therefore | possible to look inside a backup dump file and determine exactly | which backup session the dump file came from. However, this file | is not merely for your information; its presence and contents are | critical to the proper operation of the system's recovery | process. These are related to the pg_start_backup function and apply whether you run that function directly or use pg_basebackup, which runs it. > The other files I removed were the old postgresql.pid file from > the primary You should remove that, or exclude it from your backup in the first place. > and a file called archiving_active, which I use for controlling > whether postgresql writes WAL files or not. That's based on your particular archiving strategy; without more info on that I can't comment. > Seems a little funny to me that I've done this same procedure for > over 4 months with no problems, and today was the first time it > bit me. It's sorta like crossing a highway without looking either way.=A0 It might work many times.=A0 Then again, a Mac truck might be coming just that one time.=A0 If you would like to have it work consistently, rather than gamble each time, don't copy WAL files from the pg_xlog directory of a live server except through the documented methods, and don't delete the backup_label file.=A0 If you do either of those things you risks errors like you just saw. Worse, you risk not getting errors but having a silently corrupted database.=A0 Unless you enjoy the thrill of it....=A0 ;-) -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin