Re: VM corruption on standby

From: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Melanie Plageman <melanieplageman(at)gmail(dot)com>
Subject: Re: VM corruption on standby
Date: 2025-08-07 14:09:39
Message-ID: CAJ7c6TMAOrXz-=SPvgW0JtFktxSDBTZ5GVRyZ=wT5MqkbFnMhQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> This is a tricky bug. Do you also have a proposal of a particular fix?

If my understanding is correct, we should make a WAL record with the
XLH_LOCK_ALL_FROZEN_CLEARED flag *before* we modify the VM but within
the same critical section (in order to avoid race conditions within
the same backend).

A draft patch is attached. It makes the test pass and doesn't seem to
break any other tests.

Thoughts?

Attachment Content-Type Size
v2-0001-Corrupt-VM-on-standby.patch text/x-patch 10.6 KB
v2-0002-Bugfix-TODO-FIXME-write-a-better-message.patch text/x-patch 1.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2025-08-07 14:14:00 Re: VM corruption on standby
Previous Message Magnus Hagander 2025-08-07 13:38:10 Re: [PING] fallocate() causes btrfs to never compress postgresql files