Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 203B41337C0C for ; Tue, 19 Apr 2011 12:37:31 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 28088-01-5 for ; Tue, 19 Apr 2011 15:37:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wy0-f174.google.com (mail-wy0-f174.google.com [74.125.82.174]) by mail.postgresql.org (Postfix) with ESMTP id DD9C41337C95 for ; Tue, 19 Apr 2011 12:29:36 -0300 (ADT) Received: by wya21 with SMTP id 21so4912267wya.19 for ; Tue, 19 Apr 2011 08:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=WMnt9kLQiUOloN8lXeH1K2NUSeE+l3XmbKFa0r09Ovo=; b=DNUUw9gm/c1p9zlspKCXjmyqC1W8B+8d3rSKvdrdGvYtSg7kbB1W8BX5+OrTdBMPwt AvfmBzWSnnOuDe0Zw/dNoZDSwhNMXLBnEK4uZzhG+aGh9G5D24Z+fYBXTMDQEOReL3U2 HtSplwzcAXRLUJhPjfp6AO+A2S2M3HfffAPWI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=uymv22O+rj9xhm8neBROAudsC5rP5uH4QCfKI/YXtGZh7PNt2bprZg+fqy/nFwt0/B M/Ta82idG0rN1XJ93feAssd4l9mzNBN7iQy2GwYTNTjCz2lJMNv+B/2Qs52muVpUaUNK g/F7YgUMOQPSP+TrKn5FBRi2uK7ThWez/5Mvw= Received: by 10.216.62.210 with SMTP id y60mr12838889wec.111.1303226975604; Tue, 19 Apr 2011 08:29:35 -0700 (PDT) Received: from [10.10.10.48] (89-96-231-108.ip14.fastwebnet.it [89.96.231.108]) by mx.google.com with ESMTPS id m2sm6745wer.37.2011.04.19.08.29.33 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 19 Apr 2011 08:29:34 -0700 (PDT) Message-ID: <4DADAA5C.6040107@gmail.com> Date: Tue, 19 Apr 2011 17:29:32 +0200 From: rudi User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: pgsql-admin Subject: Re: Streaming replication: rsync to switchover References: <4DAC7205.8080203@kemen.it> <4DAD52D8.1090006@gmail.com> <20110419121105.GA17761@cns.vt.edu> In-Reply-To: <20110419121105.GA17761@cns.vt.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.421 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, FS_REPLICA=3.599, RFC_ABUSE_POST=0.001, SARE_SPEC_REPLICA=0.72 X-Spam-Level: ** X-Archive-Number: 201104/177 X-Sequence-Number: 37358 On 04/19/2011 02:11 PM, Ray Stell wrote: > On Tue, Apr 19, 2011 at 11:16:08AM +0200, rudi wrote: >> On 04/19/2011 10:09 AM, Gerhard Hintermayer wrote: >> So you keep the old pg_xlog > > the admin book says to exclude old pg_xlog > Which book is this? So I guess something like this (from new master to former master) should be safe: $ psql -c "SELECT pg_start_backup('switchover base backup')" $ rsync -av /var/lib/postgresql/9.0/main/ --delete --exclude server.crt --exclude server.key --exclude recovery.* --exclude postmaster.pid --exclude archive $FORMER_MASTER_ADDRESS:/var/lib/postgresql/9.0/main/ $ psql -c "SELECT pg_stop_backup()" What about the archiving directory of the former slave (now master)? It should be cleaned guess, in case it will be slave again. If I look at that directory, after a failover it is not empty. This looks strange to me because pg_cleanup_archive should have already cleaned it. BTW, is there any documentation about the logic behind pg_xlog filenames? It is really obscure and this makes really hard understanding what's going on. I'm sure that most recent mtime gives me the active WAL, and I can match somehow this: Latest checkpoint location: 7/F70021A0 Prior checkpoint location: 7/F7002110 Latest checkpoint's REDO location: 7/F7002168 Latest checkpoint's TimeLineID: 2 with this filename: 0000000200000007000000F7 and that's all. thanks, -- rd Peel your own image from the mirror. Sit. Feast on your life.