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

From Heikki Linnakangas
Subject Re: Bug in MultiXact replay compat logic for older minor version after crash-recovery
Date
Msg-id 5b7f0a04-4a60-44bb-9d2c-8917af0b10fa@iki.fi
Whole thread Raw
In response to Re: Bug in MultiXact replay compat logic for older minor version after crash-recovery  (Andrey Borodin <x4mmm@yandex-team.ru>)
Responses Re: Bug in MultiXact replay compat logic for older minor version after crash-recovery
List pgsql-hackers
On 20/03/2026 15:39, Andrey Borodin wrote:
>> On 20 Mar 2026, at 16:19, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
>>
>> Hmm, after startup, before we have zeroed any pages, it still works though. So I think my patch works, but it means
thattracking the latest page we have zeroed is not merely an optimization to avoid excessive
SimpleLruDoesPhysicalPageExist()calls, it's needed for correctness. Need to adjust the comments for that.
 
> 
> If we are sure buffers have no this page we can detect it via FS.
> Otherwise... nothing bad can happen, actually. We might get false positive and zero the page once more.

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.

> If we got init_needed==false, maybe cache it for this page and set last_initialized_offsets_page = pageno?
> Or, perhaps, XLOG_MULTIXACT_ZERO_OFF_PAGE will do it for us anyway, but a bit later.

My patch does set last_initialized_offsets_page = pageno, if it 
initializes the page, so yeah I think we're good there.

- Heikki




pgsql-hackers by date:

Previous
From: Nitin Jadhav
Date:
Subject: Re: Change checkpoint‑record‑missing PANIC to FATAL
Next
From: Peter Eisentraut
Date:
Subject: Re: SQL Property Graph Queries (SQL/PGQ)