Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtzCm-0003ld-Fs for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Feb 2019 18:24:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gtzCg-000251-8y for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Feb 2019 18:24:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtzCg-00023m-1q for pgsql-hackers@lists.postgresql.org; Wed, 13 Feb 2019 18:24:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtzCb-0001Hg-9p for pgsql-hackers@lists.postgresql.org; Wed, 13 Feb 2019 18:24:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x1DIO3xf031664; Wed, 13 Feb 2019 13:24:03 -0500 From: Tom Lane To: Andres Freund cc: Thomas Munro , PostgreSQL Hackers Subject: Re: subscriptionCheck failures on nightjar In-reply-to: <20190213181225.fathyapig4sm4exa@alap3.anarazel.de> References: <17827.1549866683@sss.pgh.pa.us> <27965.1550077052@sss.pgh.pa.us> <20190213171101.6wpz7tardp3t3uvk@alap3.anarazel.de> <29708.1550079455@sss.pgh.pa.us> <20190213174151.mfylkessxmapt4io@alap3.anarazel.de> <30608.1550080759@sss.pgh.pa.us> <20190213181225.fathyapig4sm4exa@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Wed, 13 Feb 2019 10:12:25 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31662.1550082243.1@sss.pgh.pa.us> Date: Wed, 13 Feb 2019 13:24:03 -0500 Message-ID: <31663.1550082243@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > On 2019-02-13 12:59:19 -0500, Tom Lane wrote: >> Perhaps more to the point, the way this was coded, the PANIC applies >> to open() failures in fsync_fname_ext() not just fsync() failures; >> that's painting with too broad a brush isn't it? > That indeed seems wrong. Thomas? I'm not quite sure how to best fix > this though - I guess we could rename fsync_fname_ext's eleval parameter > to fsync_failure_elevel? It's not visible outside fd.c, so that'd not be > to bad? Perhaps fsync_fname() should pass the elevel through as-is, and then fsync_fname_ext() apply the data_sync_elevel() promotion only to the fsync() call not the open()? I'm not sure. The bigger picture here is that there are probably some call sites where PANIC on open() failure is appropriate too. So having fsync_fname[_ext] deciding what to do on its own is likely to be inadequate. If we fix this by allowing ENOENT to not be an error in this particular call case, that's going to involve an fsync_fname_ext API change anyway... regards, tom lane