Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLt1x-0003Gy-0v for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Sep 2020 19:05:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kLt1v-00022N-NW for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Sep 2020 19:05:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLt1v-00022G-Gg for pgsql-hackers@lists.postgresql.org; Fri, 25 Sep 2020 19:05:15 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLt1n-0002zt-Ar for pgsql-hackers@lists.postgresql.org; Fri, 25 Sep 2020 19:05:14 +0000 Received: from hnk.local (p2368131-ipbf2226funabasi.chiba.ocn.ne.jp [114.177.250.131]) by oss.nttdata.com (Postfix) with ESMTPSA id DE3D762345; Sat, 26 Sep 2020 04:05:00 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com Subject: Re: history file on replica and double switchover To: Grigory Smolkin , David Zhang , Anastasia Lubennikova , Postgres hackers References: <54b059d4-2b48-13a4-6f43-95a087c92367@postgrespro.ru> <4f7379a6-b196-70fe-708d-84a2672b3c22@oss.nttdata.com> <2823800f-897e-0799-a89a-75aa43f44e5d@oss.nttdata.com> <1c1a7d07-272b-7ced-1a1c-9a16aff33d54@highgo.ca> <7ef22f86-1232-2516-afaa-f31441d25504@oss.nttdata.com> From: Fujii Masao Message-ID: Date: Sat, 26 Sep 2020 04:05:00 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------3A7AFDB0AC7D4407D667F089" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------3A7AFDB0AC7D4407D667F089 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 2020/09/26 2:58, Grigory Smolkin wrote: > Fujii Masao, David Zhang, Anastasia Lubennikova, many thanks to you for efforts with this patch! > Can I mark it as ready for committer? Ok, but I attached the updated version of the patch. It's helpful if you review that. In the latest patch, I changed walreceiver so that it creates .done file for the streamed timeline history file when archive_mode is NOT "always". Walreceiver does the same thing for the streamed WAL files to prevent them from being archived later. Without this, the streamed WAL files can exist in pg_wal without any archive status files, and then they will be archived later accidentally because of lack of archive status. OTOH, timeline history files will not be archived later even without archive status files. So there is no strong reason to make walreceiver create .doen file for the timeline history files. But at least for me it's strange to keep the file in pg_wal without archive status. So for now I'm just inclined to create .done files.... Thought? Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION --------------3A7AFDB0AC7D4407D667F089 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="history_replica_v4.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="history_replica_v4.patch" ZGlmZiAtLWdpdCBhL2RvYy9zcmMvc2dtbC9oaWdoLWF2YWlsYWJpbGl0eS5zZ21sIGIvZG9j L3NyYy9zZ21sL2hpZ2gtYXZhaWxhYmlsaXR5LnNnbWwKaW5kZXggYmViMzA5ZTY2OC4uNDJm MDFjNTE1ZiAxMDA2NDQKLS0tIGEvZG9jL3NyYy9zZ21sL2hpZ2gtYXZhaWxhYmlsaXR5LnNn bWwKKysrIGIvZG9jL3NyYy9zZ21sL2hpZ2gtYXZhaWxhYmlsaXR5LnNnb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