Re: Block-level CRC checks

From: Aidan Van Dyk <aidan(at)highrise(dot)ca>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Greg Stark <greg(dot)stark(at)enterprisedb(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gregory Stark <stark(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Block-level CRC checks
Date: 2008-11-18 17:34:06
Message-ID: 20081118173406.GE31053@yugib.highrise.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Alvaro Herrera <alvherre(at)commandprompt(dot)com> [081118 12:25]:

> I don't think it's a matter of hoy many writes or how much IO. The
> question is locks. Right now we flip hint bits without taking any kind
> of lock on the page. If we're going to WAL-log each hint bit change,
> then we will need to lock the page to update the LSN. This will make
> changing a hint bit a very expensive operation, and maybe a possible
> cause for deadlocks.

Ya, that's obviously the worst option.

> What my patch did was log hint bits in bulk. The problem of that
> approach was precisely that it was not locking the logged page enough
> (locking before setting the "this page needs hint bits logged" bit). Of
> course, the trivial solution is just to lock the page before flipping
> hint bits, but I don't know (and I doubt) whether it would really work
> at all.

But why can't you wal-log the hint bits from the "buffered" page. then your
consitent. At least as consistent as the original write was.

So you're CRC ends up being:
Buffer the page
Calculate CRC on the buffered page
WAL (in bulk) the hint bits (and maybe CRC?)
write buffered page

--
aidan van dyk create like a god,
aidan(at)highrise(dot)ca command like a king,
http://www.highrise.ca/ work like a slave.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-11-18 17:37:26 Re: Block-level CRC checks
Previous Message Heikki Linnakangas 2008-11-18 17:31:48 Re: Block-level CRC checks