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 1qQyyA-000ACz-Ff for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Aug 2023 23:40:02 +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 1qQyy8-0011UX-V0 for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Aug 2023 23:40:01 +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 1qQyy8-0011UP-IU for pgsql-hackers@lists.postgresql.org; Tue, 01 Aug 2023 23:40:01 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qQyy6-0002R9-Cj for pgsql-hackers@lists.postgresql.org; Tue, 01 Aug 2023 23:40:00 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-686f94328a4so241581b3a.0 for ; Tue, 01 Aug 2023 16:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20221208.gappssmtp.com; s=20221208; t=1690933196; x=1691537996; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=Ao+XFb4PtIKTEDItPZCFqYII91OfHFOwHIyPlpOEShU=; b=kxatTud2Y4swrrHNVqqeSlXit2bIfi+J/IGSVu7/ChEaBNz9ErLOiuN/T1zbGrZp/S 4+XJCo5Zk/CemEpS3KZxAQy48aLZSdElcBAJhC9LURbksuRiJWF5A95MPcSuRg5KzB3q vz/jJD1NE/1k5ktO/hGXcyqbZprw6TD5HdGjZHnL5bnuAb6L1cw9gtAoHIRZddyfOkpV joQgJQfDhHEoMDhZcQOOqpFnKmDbt6sVMp4+splTjkIgjSM5lBGPCn3uRxLhzhuAkgq/ vsi8mhzhuYPRG47Rg7F5CBQ9D18KqgNff0X0oJ1ODMSEQ/Qlyc7esca3eYkzi6dzGK2D gM7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690933196; x=1691537996; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Ao+XFb4PtIKTEDItPZCFqYII91OfHFOwHIyPlpOEShU=; b=gF0rQg5RClIP7IH5jTttCXrdW1UE+9iskAEHr+mNgPfSft/99vQcu0shu5zui4SUL9 xpvvnlms5XUsdQKjOLr6xOvp+kApdr2JTsnkcNWY3SVSVc7HiloTS2e4JOF/S+7G6idr NhWtRynWtLFQubtlHNjJk1yMRsaeB+PlO4Wvhb3ku3rzS7FuDIJdHrlb9XpHJgsFTq1O JeGrN8BD2vQL3UN3ITCVfIuwmS3LHoISKePiNDjBKP/qbj0i87Tm0A2S8UVY7LqoyxoE bYgu8JjwGIDUsKjABX70kfRuPU0GMCT83TA5FhpmT7am2ddsaZdbNKO91NMHS2nBiT0Z 5ENA== X-Gm-Message-State: ABy/qLZ+oYedFrmapQavntKeVefET4Tofk7O6eWJVX1IdAo8hlR6M3rW x2bEIGAiXJvNocBASnq1f1oDTw== X-Google-Smtp-Source: APBJJlFnez5G+i9vEnFwIY9E7p28nrAEZ81b9qIuQeGsBCAQAgi2S7h486+fOjl7KR554+WAO/9m9g== X-Received: by 2002:a05:6a20:a12c:b0:132:842f:8adb with SMTP id q44-20020a056a20a12c00b00132842f8adbmr13646317pzk.23.1690933195873; Tue, 01 Aug 2023 16:39:55 -0700 (PDT) Received: from [172.24.1.43] ([12.126.244.130]) by smtp.gmail.com with ESMTPSA id e21-20020a62aa15000000b006826df9e286sm10071261pff.143.2023.08.01.16.39.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 16:39:55 -0700 (PDT) Message-ID: Subject: Re: Incorrect handling of OOM in WAL replay leading to data loss From: Jeff Davis To: Aleksander Alekseev , Postgres hackers Cc: Michael Paquier , ethmertz@amazon.com, Nathan Bossart , Masahiko Sawada Date: Tue, 01 Aug 2023 16:39:54 -0700 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2023-08-01 at 16:14 +0300, Aleksander Alekseev wrote: > Probably I'm missing something, but if memory allocation is required > during WAL replay and it fails, wouldn't it be a better solution to > log the error and terminate the DBMS immediately? We need to differentiate between: 1. No valid record exists and it must be the end of WAL; LOG and start up. 2. A valid record exists and we are unable to process it (e.g. due to OOM); PANIC. Regards, Jeff Davis