Re: FSM, now without WAL-logging - Mailing list pgsql-hackers

From Tom Lane
Subject Re: FSM, now without WAL-logging
Date
Msg-id 10998.1222288601@sss.pgh.pa.us
Whole thread Raw
In response to Re: FSM, now without WAL-logging  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> 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.

Hmm.  I seem to recall that that ordering was intentional, but I don't
recall why just now.  The code doesn't say but maybe there's something
in the archives.  It does seem a little odd since it's an apparent
violation of the wal-before-data rule.

If you wanted to be certain that the WAL record existed you'd have to
not only generate it first but fsync it, which would be a bit of a
performance hit.  OTOH I'm not sure we care about smgrtruncate being
really quick...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: FSM, now without WAL-logging
Next
From: Bruce Momjian
Date:
Subject: Re: Proposal of SE-PostgreSQL patches (for CommitFest:Sep)