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 1tGhQP-000AM9-3J for pgsql-admin@arkaria.postgresql.org; Thu, 28 Nov 2024 16:31:29 +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 1tGhQN-006CbQ-Pf for pgsql-admin@arkaria.postgresql.org; Thu, 28 Nov 2024 16:31:27 +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 1tGhQN-006CbH-ED for pgsql-admin@lists.postgresql.org; Thu, 28 Nov 2024 16:31:27 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGhQL-004WlT-1n for pgsql-admin@lists.postgresql.org; Thu, 28 Nov 2024 16:31:26 +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 4ASGVMsr2092968; Thu, 28 Nov 2024 11:31:22 -0500 From: Tom Lane To: Siraj G cc: Pgsql-admin Subject: Re: Out of Memory error triggering replica to transition into recovery mode In-reply-to: References: Comments: In-reply-to Siraj G message dated "Thu, 28 Nov 2024 08:34:57 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2092966.1732811482.1@sss.pgh.pa.us> Date: Thu, 28 Nov 2024 11:31:22 -0500 Message-ID: <2092967.1732811482@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Siraj G writes: > As the subject says, today very frequently our replica DB is going into the > recovery mode causing an outage in the application side. If you're not on this month's minor releases, perhaps you should be: Reduce memory consumption of logical decoding (Masahiko Sawada) Use a smaller default block size to store tuple data received during logical replication. This reduces memory wastage, which has been reported to be severe while processing long-running transactions, even leading to out-of-memory failures. I recall past updates that fixed other memory leaks in logical replication, too. > Pgsql: 12.2 Egad. Your version-updating strategy seriously needs a rethink. regards, tom lane