Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id E86C81337B97 for ; Mon, 18 Apr 2011 19:15:24 -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 34369-01 for ; Mon, 18 Apr 2011 22:15:18 +0000 (UTC) Received: from mx1.hub.org (mx1.hub.org [200.46.208.106]) by mail.postgresql.org (Postfix) with ESMTP id F33621337B43 for ; Mon, 18 Apr 2011 19:15:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wy0-f174.google.com (mail-wy0-f174.google.com [74.125.82.174]) by mx1.hub.org (Postfix) with ESMTP id 71F653262B20 for ; Mon, 18 Apr 2011 19:11:41 +0000 (UTC) Received: by wya21 with SMTP id 21so4205941wya.19 for ; Mon, 18 Apr 2011 12:10:52 -0700 (PDT) Received: by 10.216.188.20 with SMTP id z20mr220231wem.66.1303147015266; Mon, 18 Apr 2011 10:16:55 -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 k76sm2698027wej.19.2011.04.18.10.16.54 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Apr 2011 10:16:54 -0700 (PDT) Message-ID: <4DAC7205.8080203@kemen.it> Date: Mon, 18 Apr 2011 19:16:53 +0200 From: rd 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@postgresql.org Subject: Streaming replication: rsync to switchover 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.419 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FS_REPLICA=3.599, RCVD_IN_DNSWL_NONE=-0.0001, SARE_SPEC_REPLICA=0.72 X-Spam-Level: ** X-Archive-Number: 201104/160 X-Sequence-Number: 37341 Hi, I've setup streaming replication + file-based log-shipping, with a hot-standby. Everything's good, except I don't know which is the correct way to sync the once-master db with the newly promoted master after a switchover, 1) I shutdown the master and touch the trigger_file on the slave. Now the slave becomes the master. 2) On the old-master I create recovery.conf + archive directory for file-based log-shipping. 3) I hope I can setup the old-master with a simple rsync, because the operation could be really fast, being M and S almost identical, but I'm not sure about the correct way to rsync them: a) should I rsync --delete? b) should I delete the pg_xlog of the old master, before rsyncing? (I'm wondering what could happen if some of them never made its way to the slave, that now has become new-master) c) am I missing something? For example, I've read somewhere that one should copy pg_control and pg_stat from the old slave to the new slave but it doesn't make sense to me. thanks for any hint, -- rudi pettazzi