Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XcGp6-0000wE-L1 for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Oct 2014 16:44:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XcGp5-0002Rh-OD for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Oct 2014 16:44:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XcGp4-0002RY-Ox for pgsql-bugs@postgresql.org; Thu, 09 Oct 2014 16:44:14 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XcGoy-0005os-Q5 for pgsql-bugs@postgresql.org; Thu, 09 Oct 2014 16:44:12 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 737DF28286; Thu, 9 Oct 2014 09:44:03 -0700 (PDT) Received: from EX13-CAS-008.vmware.com (EX13-CAS-008.vmware.com [10.113.191.58]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 6076919D3D; Thu, 9 Oct 2014 09:44:03 -0700 (PDT) Received: from EX13-MBX-024.vmware.com (10.113.191.44) by EX13-MBX-001.vmware.com (10.113.191.21) with Microsoft SMTP Server (TLS) id 15.0.775.38; Thu, 9 Oct 2014 09:44:03 -0700 Received: from [192.168.1.90] (10.113.160.246) by EX13-MBX-024.vmware.com (10.113.191.44) with Microsoft SMTP Server (TLS) id 15.0.775.38; Thu, 9 Oct 2014 09:43:44 -0700 Message-ID: <5436BB3B.80500@vmware.com> Date: Thu, 9 Oct 2014 19:43:39 +0300 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.0 MIME-Version: 1.0 To: , Subject: Re: BUG #11603: replication, pg_basebackup and high load References: <20141008131927.2563.36952@wrigleys.postgresql.org> In-Reply-To: <20141008131927.2563.36952@wrigleys.postgresql.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.113.160.246] X-ClientProxiedBy: EX13-CAS-013.vmware.com (10.113.191.65) To EX13-MBX-024.vmware.com (10.113.191.44) X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 10/08/2014 04:19 PM, mdglange@gmail.com wrote: > The following bug has been logged on the website: > > Bug reference: 11603 > Logged by: Michiel > Email address: mdglange@gmail.com > PostgreSQL version: 9.4beta2 > Operating system: Linux > Description: > > The test I did involved the following: a master database with two slaves. On > the master two replication slots have been configured as per the > documentation. One slave active before I put some "heavy" load (the > environment is scaled such, that inserting a few gigabytes of insert > statements is a heavy load. This is on purpose) > > During this load I started a pg_basebackup from the master, immediately > followed (pg_basebackup && mv recovery.conf $PG_DATA/ && pg_ctl start) by > placing the prepared recovery.conf and starting this slave. The > pg_basebackup took a few hours (as expected) but starting this latter slave > would not work because the WALs were no longer available. > > I'd expect to see that pg_basebackup restores up to the last WAL, so that > regardless of the load and changes done on the (master) database replication > picks up. After pg_basebackup, the system needs to have all the WAL available from the time the backup *started*, unfortunately. Try using pg_basebackup's "--xlog-method=stream" option. That way it streams the WAL at the same time the backup is taken, making it less likely that the master will recycle the segments too quickly. Even that is not bullet-proof, though; if there's a network hickup or something that makes the backup process to stall for long enough, the master might still recycle the segments that the backup would need. Or, set up WAL archiving, and use a restore_command in the recovery.conf file to pull the files from the archive. I didn't understand what replication slots have to do with this though; sorry if I misunderstood the whole thing.. - Heikki -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs