RE: [bug fix] Cascaded standby cannot start after a clean shutdown - Mailing list pgsql-hackers

From Tsunakawa, Takayuki
Subject RE: [bug fix] Cascaded standby cannot start after a clean shutdown
Date
Msg-id 0A3221C70F24FB45833433255569204D1F8D7667@G01JPEXMBYT05
Whole thread Raw
In response to Re: [bug fix] Cascaded standby cannot start after a clean shutdown  (Michael Paquier <michael@paquier.xyz>)
Responses Re: [bug fix] Cascaded standby cannot start after a clean shutdown
List pgsql-hackers
From: Michael Paquier [mailto:michael@paquier.xyz]
> By the way, as long as I have my mind of it.  Another strategy would be
> to just make the checks in XLogReadRecord() a bit smarter if the whole record
> header is not on the page.  If we check at least for
> AllocSizeIsValid(total_len) then there this code would not fail on an
> allocation as you user reported.  Still this misses the case where a record
> size is lower than 1GB but invalid so you would allocate allocate_recordbuf
> for nothing :(

That was my first thought, and I gave it up.  As you say, XLogReadRecord() could allocate up to 1 GB of memory for a
garbage. That allocation can fail due to memory shortage, which prevents the recovery from proceeding.
 


Regards
Takayuki Tsunakawa






pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: ALTER TABLE ADD COLUMN fast default
Next
From: Michael Paquier
Date:
Subject: Re: Kerberos test suite