Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id D73811337B39 for ; Sat, 6 Nov 2010 19:52:48 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 76173-09 for ; Sat, 6 Nov 2010 22:52:41 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from acidenitrix.villemain.org (acidenitrix.villemain.org [91.121.90.165]) by mail.postgresql.org (Postfix) with ESMTP id E35EC1337B49 for ; Sat, 6 Nov 2010 19:52:40 -0300 (ADT) Received: from 89-158-241-48.rev.dartybox.com ([89.158.241.48] helo=DimIMac.local) by acidenitrix.villemain.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PErci-0008Bo-Ok; Sat, 06 Nov 2010 23:52:36 +0100 Received: by DimIMac.local (Postfix, from userid 501) id 9EC1811668C5; Sat, 6 Nov 2010 23:52:29 +0100 (CET) From: Dimitri Fontaine To: Hannu Krosing Cc: Dimitri Fontaine , Josh Berkus , postgres hackers Subject: Re: Simplifying replication Organization: 2ndQuadrant References: <4CBCE356.2080703@agliodbs.com> <1288996741.2313.370.camel@hvost> <1289067736.2313.1896.camel@hvost> User-Mail-Address: dimitri@2ndQuadrant.fr Date: Sat, 06 Nov 2010 23:52:29 +0100 In-Reply-To: <1289067736.2313.1896.camel@hvost> (Hannu Krosing's message of "Sat, 06 Nov 2010 20:22:16 +0200") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.419 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FS_REPLICA=3.599, SARE_SPEC_REPLICA=0.72 X-Spam-Level: ** X-Archive-Number: 201011/282 X-Sequence-Number: 173425 Hannu Krosing writes: >> > To make pg_basebackup.py self-sufficient it should also open 2nd >> > connection to the same master and make sure that all WAL files are >> > copied for the duration of base copy. Done now, please have a look and try it if possible: https://github.com/dimitri/pg_basebackup > btw, as next step you could backport this to 8.x and have most of the > benefits of SR. It should not be very hard to keep track of wal position > inside a pl/pythonu function and send one or more records back in form of You now have the -x and -D options to set that up, but I didn't check the backport part: it still depends on the pg_bb_list_files() function to get the recursive listing of the pg_xlog directory, and it does that using a WITH RECURSIVE query. The way I did it is to only copy the (whole) WAL again if its ctime changed since last loop. Also pg_basebackup won't start a backup if you run it on its own, I don't think that's what you want here. Oh, as I needed to fork() a process to care for the pg_xlog in a loop while the base backup is sill ongoing, I added a -j --jobs option so that you can hammer the master some more by having more than one process doing the copying. Regards, -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support