Tom Lane wrote:
> Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
>> Zdenek Kotala wrote:
>>> What's about truncate FSM during WAL replay of main fork truncation record?
>
>> That would work, except that there's no WAL record for truncating the
>> main fork.
>
> Whaddya mean there's no WAL record for that? smgrtruncate produces one.
Ooh, I didn't realize that!
Hmm. The smgrtuncate WAL record is generated after the file is
truncated, so there's still a small window there, where we can be left
with a truncated main fork, but no smgrtruncate record for it, and thus
the page of the FSM representing the truncated blocks doesn't get zeroed
at replay.
-- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com