Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XcH5F-0001nH-L7 for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Oct 2014 17:00:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XcH5E-0007DU-FQ for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Oct 2014 17:00:56 +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 1XcH5D-0007DO-Ss for pgsql-bugs@postgresql.org; Thu, 09 Oct 2014 17:00:55 +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 1XcH58-0006CS-4w for pgsql-bugs@postgresql.org; Thu, 09 Oct 2014 17:00:54 +0000 Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com [10.113.161.72]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 092C1987DB; Thu, 9 Oct 2014 10:00:46 -0700 (PDT) Received: from EX13-CAS-012.vmware.com (EX13-CAS-012.vmware.com [10.113.191.64]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 01ADEB07CA; Thu, 9 Oct 2014 10:00:46 -0700 (PDT) Received: from EX13-MBX-024.vmware.com (10.113.191.44) by EX13-MBX-004.vmware.com (10.113.191.24) with Microsoft SMTP Server (TLS) id 15.0.775.38; Thu, 9 Oct 2014 10:00:45 -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 10:00:44 -0700 Message-ID: <5436BF37.2010307@vmware.com> Date: Thu, 9 Oct 2014 20:00: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: Andres Freund , CC: Subject: Re: BUG #11603: replication, pg_basebackup and high load References: <20141008131927.2563.36952@wrigleys.postgresql.org> <20141009165415.GE29124@awork2.int> In-Reply-To: <20141009165415.GE29124@awork2.int> Content-Type: text/plain; charset="windows-1252"; 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/09/2014 07:54 PM, Andres Freund wrote: > On 2014-10-08 13:19:27 +0000, mdglange@gmail.com wrote: >> 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) > > Replication slots currently only reserve resources after they've been > used the first time. I.e. when you create a physical replication slot it > doesn't immediately reserve resources - a client needs to connect to it > once, telling it from where on to reserve resources. Oh, now I understand what Michiel was trying to do with the replication slots. The idea is to prevent the master from recycling the segments while the backup runs, by creating a replication slot before the backup. > You can see the slot's reserved resources in the pg_replication_slots > view. > > So, what you could do is to connect to the slots once, for a short time, > using pg_receivexlog --slots. Or just use the -X stream method for > pg_basebackup. Hmm. Should we have an additional flag to "pg_basebackup -R" to create and "reserve" a replication slot, too, all in one command? That would be handy, although there's some potential of shooting your foot with replication slots; if the backup is aborted for some reason, the slot remains. - Heikki -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs