Re: Bug in MultiXact replay compat logic for older minor version after crash-recovery

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: "段坤仁(刻韧)" <duankunren(dot)dkr(at)alibaba-inc(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in MultiXact replay compat logic for older minor version after crash-recovery
Date: 2026-03-20 17:05:53
Message-ID: C44AF20B-7AA3-42A6-B30D-08DEFD2E3F8C@yandex-team.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 20 Mar 2026, at 18:14, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
>
> Zeroing the page again is dangerous because the CREATE_ID records can be out of order. The page might already contain some later multixids, and zeroing will overwrite them.

I see only cases when it's not a problem: we zeroed page, did not flush it, thus did not extend the file, crashed, tested FS, zeroed page once more, overwrote again by replaying WAL, no big deal.
We should never zero a page with offsets, that will not be replayed by WAL.

If the page was persisted, even partially, we will read it from disk without zeroing out.

Best regards, Andrey Borodin.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kirill Reshke 2026-03-20 17:33:21 Re: Truncate logs by max_log_size
Previous Message Jianghua Yang 2026-03-20 17:02:44 basebackup: add missing deflateEnd() in gzip compression sink