Re: Adding new flags to XLogRecord

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Simon Riggs <simon(at)2ndQuadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Adding new flags to XLogRecord
Date: 2008-09-18 12:50:51
Message-ID: 16570.1221742251@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> Or, we could store only the delta between current record and the
> previous one. Assuming we know what the current record is, that wouldn't
> lose any precision. That way xl_prev only needs to be as big as the
> biggest possible WAL record we can have.

The trouble with either approach is that it discards forensic
intelligence in the name of bit squeezing. The high bits of xl_prev are
the only direct evidence *within* a WAL record of where it thinks it is
in the WAL sequence, and the back-comparison against where we thought
the previous record was is correspondingly the only really strong
protection against a torn page problem within a WAL page, should the
sector boundary happen to fall exactly at a WAL record boundary.

I fear that a delta would be completely unacceptable for that check,
because it's entirely possible that a lot of different WAL records would
be the same size (consider bulk load into a fixed-width table for an
example). Simon's scheme merely removes some of the protection, not all
of it ;-).

But I don't really like removing any of it. If we need more bits in WAL
headers, then so be it --- they'd likely still be smaller than they were
a couple releases ago.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zdenek Kotala 2008-09-18 13:04:43 Re: FSM patch - performance test
Previous Message Tom Lane 2008-09-18 12:38:58 Re: Adding new flags to XLogRecord