Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YHXln-00057I-T6 for pgsql-hackers@arkaria.postgresql.org; Sat, 31 Jan 2015 13:07:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YHXln-0006eD-Aa for pgsql-hackers@arkaria.postgresql.org; Sat, 31 Jan 2015 13:07:27 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YHXlk-0006XJ-AA for pgsql-hackers@postgresql.org; Sat, 31 Jan 2015 13:07:24 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YHXlg-0005Vq-L1 for pgsql-hackers@postgresql.org; Sat, 31 Jan 2015 13:07:22 +0000 Received: from intern.anarazel.de (unknown [151.216.224.0]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 11C6D460001; Sat, 31 Jan 2015 14:07:18 +0100 (CET) Date: Sat, 31 Jan 2015 14:07:17 +0100 From: Andres Freund To: Heikki Linnakangas Cc: Fujii Masao , Borodin Vladimir , PostgreSQL-development Subject: Re: Streaming replication and WAL archive interactions Message-ID: <20150131130717.GN24213@alap3.anarazel.de> References: <548AF1CB.80702@vmware.com> <689EB259-44C2-4820-B901-4F6B1C55A1E4@simply.name> <549083D6.1000301@vmware.com> <54949108.3030109@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54949108.3030109@vmware.com> X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Hi, On 2014-12-19 22:56:40 +0200, Heikki Linnakangas wrote: > This add two new archive_modes, 'shared' and 'always', to indicate whether > the WAL archive is shared between the primary and standby, or not. In > shared mode, the standby tracks which files have been archived by the > primary. The standby refrains from recycling files that the primary has > not yet archived, and at failover, the standby archives all those files too > from the old timeline. In 'always' mode, the standby's WAL archive is > taken to be separate from the primary's, and the standby independently > archives all files it receives from the primary. I don't really like this approach. Sharing a archive is rather dangerous in my experience - if your old master comes up again (and writes in the last wal file) or similar, you can get into really bad situations. What I was thinking about was instead trying to detect the point up to which files were safely archived by running restore command to check for the presence of archived files. Then archive anything that has valid content and isn't yet archived. That doesn't sound particularly complicated to me. Greetings, Andres Freund -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers