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 1jiUEm-0000rl-D9 for pgsql-general@arkaria.postgresql.org; Tue, 09 Jun 2020 02:43:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jiUEl-0006Cn-3H for pgsql-general@arkaria.postgresql.org; Tue, 09 Jun 2020 02:43:39 +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 1jiUEk-0006Cg-Ry for pgsql-general@lists.postgresql.org; Tue, 09 Jun 2020 02:43:38 +0000 Received: from uucp.dinoex.org ([2a0b:f840::12]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiUEe-0005zK-JT for pgsql-general@lists.postgresql.org; Tue, 09 Jun 2020 02:43:38 +0000 Received: from uucp.dinoex.sub.de (uucp.dinoex.org [185.220.148.12]) by uucp.dinoex.org (8.16.0.45/8.16.0.45) with ESMTPS id 0592hH8L054335 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Tue, 9 Jun 2020 04:43:18 +0200 (CEST) (envelope-from pmc@citylink.dinoex.sub.org) X-MDaemon-Deliver-To: X-Authentication-Warning: uucp.dinoex.sub.de: Host uucp.dinoex.org [185.220.148.12] claimed to be uucp.dinoex.sub.de Received: (from uucp@localhost) by uucp.dinoex.sub.de (8.16.0.45/8.16.0.45/Submit) with UUCP id 0592hHms054334 for pgsql-general@lists.postgresql.org; Tue, 9 Jun 2020 04:43:17 +0200 (CEST) (envelope-from pmc@citylink.dinoex.sub.org) Received: from gate.oper.dinoex.org (gate-e [192.168.98.2]) by citylink.dinoex.sub.de (8.15.2/8.15.2) with ESMTP id 0592YtVv062036 for ; Tue, 9 Jun 2020 04:34:55 +0200 (CEST) (envelope-from peter@gate.oper.dinoex.org) Received: from gate.oper.dinoex.org (gate-e [192.168.98.2]) by gate.oper.dinoex.org (8.15.2/8.15.2) with ESMTP id 0592XQhl061812 for ; Tue, 9 Jun 2020 04:33:26 +0200 (CEST) (envelope-from peter@gate.oper.dinoex.org) Received: (from peter@localhost) by gate.oper.dinoex.org (8.15.2/8.15.2/Submit) id 0592XQ7l061811 for pgsql-general@lists.postgresql.org; Tue, 9 Jun 2020 04:33:26 +0200 (CEST) (envelope-from peter) Date: Tue, 9 Jun 2020 04:33:26 +0200 From: Peter To: pgsql-general@lists.postgresql.org Subject: Re: Something else about Redo Logs disappearing Message-ID: <20200609023326.GA61487@gate.oper.dinoex.org> References: <20200609000253.GA21670@gate.oper.dinoex.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Milter: Spamilter (Reciever: uucp.dinoex.sub.de; Sender-ip: 185.220.148.12; Sender-helo: uucp.dinoex.sub.de;) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (uucp.dinoex.org [185.220.148.12]); Tue, 09 Jun 2020 04:43:21 +0200 (CEST) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Actually, the affair had some good side: as usual I was checking my own designs first and looking for flaws, and indeed I found one: If you do copy out the archive logs not directly to tape, but to some disk area for further processing, then there is an issue with possible loss. If you do it like the docs say, with a command like this: archive_command = 'test ! -f /mnt/server/archivedir/%f && cp %p +/mnt/server/archivedir/%f' # Unix That "cp" is usually not synchronous. So there is the possibility that this command terminates successfully, and reports exitcode zero back to the Postgres, and then the Postgres will consider that log being safely away. But the target of the copy may not yet been written to disk. If at that point a power loss happens, the log may become missing/damaged/ incomplete, while the database may or may not consider it done when restarting. Therefore, mounting such a target filesystem in all-synchronous mode might be a good idea. (UFS: "-o sync", ZFS: "set sync=always") cheerio, PMc