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 1ouhP8-0006kG-Pe for pgsql-general@arkaria.postgresql.org; Mon, 14 Nov 2022 21:54:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ouhP6-0001uY-O5 for pgsql-general@arkaria.postgresql.org; Mon, 14 Nov 2022 21:54:08 +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 1ouhP6-0001uP-DX for pgsql-general@lists.postgresql.org; Mon, 14 Nov 2022 21:54:08 +0000 Received: from smtp.burggraben.net ([88.198.69.140]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ouhP3-0002Mg-Dp for pgsql-general@postgresql.org; Mon, 14 Nov 2022 21:54:07 +0000 Received: from elch.exwg.net (elch.exwg.net [IPv6:2001:470:7120:1:127b:44ff:fe4f:148d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "elch.exwg.net", Issuer "R3" (not verified)) by smtp.burggraben.net (Postfix) with ESMTPS id 11CD5C00313; Mon, 14 Nov 2022 22:54:04 +0100 (CET) Received: by elch.exwg.net (Postfix, from userid 1000) id 6BBC33AB04; Mon, 14 Nov 2022 22:54:03 +0100 (CET) Date: Mon, 14 Nov 2022 22:54:03 +0100 From: Christoph Moench-Tegeder To: klaus.mailinglists@pernau.at Cc: pgsql-general@postgresql.org Subject: Re: PANIC: could not flush dirty data: Cannot allocate memory Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.8 (2022-11-05) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ## klaus.mailinglists@pernau.at (klaus.mailinglists@pernau.at): > On several servers we see the error message: PANIC: could not flush > dirty data: Cannot allocate memory As far as I can see, that "could not flush dirty data" happens total three times in the code - there are other places where postgresql could PANIC on fsync()-and-stuff-related issues, but they have different messages. Of these three places, there's an sync_file_range(), an posix_fadvise() and an msync(), all in src/backend/storage/file/fd.c. "Cannot allocate memory" would be ENOMEM, which posix_fadvise() does not return (as per it's docs). So this would be sync_file_range(), which could run out of memory (as per the manual) or msync() where ENOMEM actually means "The indicated memory (or part of it) was not mapped". Both cases are somewhat WTF for this setup. What filesystem are you running? Regards, Christoph -- Spare Space