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 1mo0r9-0006sB-6I for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Nov 2021 10:10:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mo0r8-0002el-3r for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Nov 2021 10:10:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mo0r7-0002ec-MM for pgsql-hackers@lists.postgresql.org; Fri, 19 Nov 2021 10:10:53 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mo0r4-0007qX-JN for pgsql-hackers@lists.postgresql.org; Fri, 19 Nov 2021 10:10:52 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 87DAA5C0136; Fri, 19 Nov 2021 05:10:48 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 19 Nov 2021 05:10:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=gUvihCyibyQ04d13NqSMpWLXYBBCegHS1zaLyxjlq A8=; b=mkTLAAS6svODXsy8ZRw3WtVw7aaOj/W9dIqQCZojthU3TV0sgumHI3YDo aUl8RXzuOxwEO6lxc8nRsLJjVj5YQMMDIXmHeUTagTR73Rro/zJJq4XpzEBdyN3A Dgq/tI9wV3qeUyJWIl3WmodIBUDgtaabyiAYAAN40xebC0Eb/dlBa5D2sgzyGE2j OY6wivikNoKRUF+sxh7qcnqHUf3LAW/OO3bK+qDMpegJ8ue1nlDFTe31ybqXgClt RTxC0P2bFY4b+xLEwgcIhAbCeqYefBLmQG30zSAvz3Z2oY8ys1IzBAx+TmUtv9rr 4vB4NljLoL8qg02C2vTBbzoZHVS4w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfeekgdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthejre dttdefjeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdr vghishgvnhhtrhgruhhtsegvnhhtvghrphhrihhsvggusgdrtghomheqnecuggftrfgrth htvghrnhepfeejgeehteeuhfevveduleeufedtjeetiefftedvudfhtdeifefgueettdev gefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepph gvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 19 Nov 2021 05:10:47 -0500 (EST) Message-ID: <5d51a9cf-8f2e-a854-424f-001f0a260a8b@enterprisedb.com> Date: Fri, 19 Nov 2021 11:10:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: Deficient error handling in pg_dump and pg_basebackup Content-Language: en-US To: Tom Lane , pgsql-hackers@lists.postgresql.org References: <1343113.1636489231@sss.pgh.pa.us> From: Peter Eisentraut In-Reply-To: <1343113.1636489231@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 09.11.21 21:20, Tom Lane wrote: > Why is this different from the half-dozen > other fsync-error cases in the same file? Why, if fsync failure > here is so catastrophic, is it okay to just return a normal failure > code when tar_close doesn't even get to this point because of some > earlier error? At the very least it seems like it'd be preferable > to do the exit(1) at the caller level. > > The addition of the exit(1) seems to have been intentional in > 1e2fddfa3, so cc'ing Peter for comment. That commit addressed the behavior of fsync() failure in pg_receivewal and pg_recvlogical, which are long-running daemon processes, so this change was analogous to the server-side changes at the time. I don't know what the behavior of fsync() failure in pg_basebackup should be, so calls that are only reachable from pg_basebackup are currently being handled differently.