Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1svudH-000eu3-OQ for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Oct 2024 08:22:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1svudG-00CPlO-VR for pgsql-bugs@arkaria.postgresql.org; Wed, 02 Oct 2024 08:22:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1svudG-00CPlG-KZ for pgsql-bugs@lists.postgresql.org; Wed, 02 Oct 2024 08:22:50 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1svudC-00299c-CO for pgsql-bugs@lists.postgresql.org; Wed, 02 Oct 2024 08:22:49 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 4251C1BF205; Wed, 2 Oct 2024 08:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vondra.me; s=gm1; t=1727857365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6JazVYuS3xRofUi9lqVJFzPc9KbInm71T+6wCffZ2d8=; b=Ed7gjZDkNO3cb/MvVV6kYiwJYKf2pvYuzc1HxGEjEz9zT1+SeXeMSoYH1PKqMVD59vVzYT 5uEdG1Q/9TgRZAYLYir7tiYwpbk8TnMDclE5oKnZGq465uNFOCCJU4jvkKrqgsYor/mU+1 Z+lVq0D/4n3MoXqqCn69C3OZiVOVFRBa4FlWi/ihCBIDE/BMbfZ50yEzs1tiFoPmwOrVZA BiDT4Vv/idmwWUpGsSiXLyoN1vYZ7Ty5tdyo5e2uVuY5Vbqt+YPHUzcG7rYrcNfkzidcR3 PKl2OzmWzKg77+8UMslKL7lX4sAnC/ZQNclLKNhYZjP0YSfJG9+q7dfSokRoqg== Message-ID: <0ed6a6f6-e868-41d7-b28e-0a09362c35f1@vondra.me> Date: Wed, 2 Oct 2024 10:22:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Linux OOM killer To: Laurenz Albe , Ariel Tejera , pgsql-bugs@lists.postgresql.org References: Content-Language: en-US From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: tomas@vondra.me List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/2/24 06:16, Laurenz Albe wrote: > On Tue, 2024-10-01 at 12:17 -0600, Ariel Tejera wrote: >> Hi.  I hope this message finds you well. >> >> The issue is that one of our Postgres servers hit a bug and was killed by linux OOM, as >> shown in the lines below, showing two events: >> >> We were able to fix this problem adjusting the server configuration with: >> enable_memoize = off >> >> Our Postgres version is 14.5  >> Linux AWS linux2 (with diverse concurrent workloads) >> Ram 32GB >> Database size 200 GB  >> >> This is the first reproducible bug I've found in 20 years using postgres, heavily (!) >> >> As this bug is associated with large databases, it is impractical to offer a reproducible example for it. >> We hope, however, that this report will be of some use for the Postgres project. > > First of all, update to 14.latest. I find at least one bug fixed in this area: > https://postgr.es/c/e4b95b9b02, discussed in https://postgr.es/m/83281eed63c74e4f940317186372abfd%40cft.ru > > Then, disable memory overcommit, so that you don't get killed by the OOM killer. > Then you will get an "out of memory" error and a memory context dump in the log. > We'd need to see that to figure out if it really is a bug. > FWIW I don't think anyone can investigate this without more information. In particular, we'd need the query plan triggering the issue, with info about the schema (which data types, ...) and data sizes. And the memory context information - either logged during OOM, or collected using gdb. But yeah, definitely update to newest 14.x first. Chances are this is already fixed. regards -- Tomas Vondra