Re: Incorrect handling of OOM in WAL replay leading to data loss

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Aleksander Alekseev <aleksander(at)timescale(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, ethmertz(at)amazon(dot)com, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: Re: Incorrect handling of OOM in WAL replay leading to data loss
Date: 2023-08-01 23:39:54
Message-ID: dba769593520d8e33d913db8b4a254c5e5608c11.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2023-08-01 23:40:45 Re: pgsql: Fix search_path to a safe value during maintenance operations.
Previous Message Ranier Vilela 2023-08-01 23:38:40 Re: Support to define custom wait events for extensions