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 1ounCf-00018e-GH for pgsql-general@arkaria.postgresql.org; Tue, 15 Nov 2022 04:05:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ounCd-0004zE-Hu for pgsql-general@arkaria.postgresql.org; Tue, 15 Nov 2022 04:05: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 1ounCd-0004yx-7X for pgsql-general@lists.postgresql.org; Tue, 15 Nov 2022 04:05:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ounCY-0005QI-6p for pgsql-general@postgresql.org; Tue, 15 Nov 2022 04:05:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 2AF45NJR1004347; Mon, 14 Nov 2022 23:05:23 -0500 From: Tom Lane To: Thomas Munro cc: Christoph Moench-Tegeder , klaus.mailinglists@pernau.at, pgsql-general@postgresql.org Subject: Re: PANIC: could not flush dirty data: Cannot allocate memory In-reply-to: References: Comments: In-reply-to Thomas Munro message dated "Tue, 15 Nov 2022 16:03:40 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1004345.1668485123.1@sss.pgh.pa.us> Date: Mon, 14 Nov 2022 23:05:23 -0500 Message-ID: <1004346.1668485123@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thomas Munro writes: > It has been argued before that we might have been over-zealous > applying the PANIC promotion logic to sync_file_range(). It's used to > start asynchronous writeback to make the later fsync() call fast, so > it's "only a hint", but I have no idea if it could report a writeback > error from the kernel that would then be consumed and not reported to > the later fsync(), so I defaulted to assuming that it could. Certainly, if it reports EIO, we should panic. But maybe not for ENOMEM? One would assume that that means that the request didn't get queued for lack of in-kernel memory space ... in which case "nothing happened". regards, tom lane