Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YkoJP-00020T-5V for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Apr 2015 06:39:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YkoJN-0005xb-TG for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Apr 2015 06:39:05 +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 1YkoJM-0005xS-ED for pgsql-hackers@postgresql.org; Wed, 22 Apr 2015 06:39:04 +0000 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YkoJJ-00048S-8x for pgsql-hackers@postgresql.org; Wed, 22 Apr 2015 06:39:02 +0000 Received: by wicmx19 with SMTP id mx19so79075246wic.1 for ; Tue, 21 Apr 2015 23:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:reply-to:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=9f1895fZOIPL+DdUWUcv5xq5D2A/OyOE+grm+NIK04o=; b=w2dq15f7A025irT+vIuWislqMAw0UW3xRlrkEjh5oLbN0g4WlNBwdCXwt5uLlOgiJ6 2Mn8YNNwI1zpTS2ukTuI49mk6Eigz/ET/XEIpD+GaL/6438EEBHmjLiWamwrjLKFrr6D vqrQWbfMng/Rx9kMPDQLGSPbgkzwVR8XCO2tcmEsF7VF+EvMefo/CcOQSTgg9B5jX3GI NEoME12jOXmGKJEcQOOp7RW6QnYmU7BxeZAkHbpW9IQgjR6DMt1p2bd6+IMbf4+Mji31 zv1pHY6MHLYztQcMQH2Z9Bis+T53tMQrhl+tf7HPMnymcidDFOFzjCKM1lJ7fXw4ysn3 4B8g== X-Received: by 10.180.76.231 with SMTP id n7mr3002621wiw.44.1429684739605; Tue, 21 Apr 2015 23:38:59 -0700 (PDT) Received: from [192.168.1.99] (dsl-hkibrasgw1-58c38f-82.dhcp.inet.fi. [88.195.143.82]) by mx.google.com with ESMTPSA id g14sm5795680wjs.47.2015.04.21.23.38.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Apr 2015 23:38:58 -0700 (PDT) Message-ID: <553741FE.1080403@iki.fi> Date: Wed, 22 Apr 2015 09:38:54 +0300 From: Heikki Linnakangas Reply-To: hlinnaka@iki.fi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0 MIME-Version: 1.0 To: Michael Paquier , Robert Haas CC: Venkata Balaji N , Andres Freund , Fujii Masao , Borodin Vladimir , PostgreSQL-development Subject: Re: Streaming replication and WAL archive interactions References: <548AF1CB.80702@vmware.com> <689EB259-44C2-4820-B901-4F6B1C55A1E4@simply.name> <549083D6.1000301@vmware.com> <54949108.3030109@vmware.com> <552FA38F.9060005@iki.fi> <5535FE71.1010905@iki.fi> <55362CAD.2000207@iki.fi> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.4 (--) 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 On 04/22/2015 03:30 AM, Michael Paquier wrote: > This is going to change a behavior that people are used to for a > couple of releases. I would not mind having this patch do > "archive_mode = on during recovery" => archive only segments generated > by this node + the last partial segment on the old timeline at > promotion, without renaming to preserve backward compatible behavior. > If master and standby point to separate archive locations, this way > the operator can sort out later the one he would want to use. If they > point to the same location, archive_command scripts already do > internally such renaming, at least that's what I suspect an > experienced user would do, now it is true that not many people are > experienced in this area I see mistakes regarding such things on a > weekly basis... This .partial segment renaming is something that we > should let the archive_command manage with its internal logic. Currently, the archive command doesn't know if the segment it's archiving is partial or not, so you can't put any logic there to manage it. But if we archive it with the .partial suffix, then you can put logic in the restore_command to check for .partial files, if you really want to. I feel that the best approach is to archive the last, partial segment, but with the .partial suffix. I don't see any plausible real-world setup where the current behaviour would be better. I don't really see much need to archive the partial segment at all, but there's also no harm in doing it, as long as it's clearly marked with the .partial suffix. BTW, pg_receivexlog also uses a ".partial" file, while it's streaming WAL from the server. The .partial suffix is removed when the segment is complete. So there's some precedence to this. pg_receivexlog adds just ".partial" to the filename, it doesn't add any information of what portion of the file is valid like I suggested here, though. Perhaps we should follow pg_receivexlog's example at promotion too, for consistency. - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers