Re: corrupt pages detected by enabling checksums

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: corrupt pages detected by enabling checksums
Date: 2013-04-30 10:58:46
Message-ID: CA+U5nM+UvtgUEZmsOMJEt7e+FgAFOKc7h7+qxKNh8MCj4HXYcg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 9 April 2013 08:36, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:

> 1. I believe that the issue I brought up at the end of this email:
>
> http://www.postgresql.org/message-id/1365035537.7580.380.camel@sussancws0025
>
> is a real issue. In lazy_vacuum_page(), the following sequence can
> happen when checksums are on:
>
> a. PageSetAllVisible
> b. Pass heap page to visibilitymap_set
> c. visibilitymap_set logs the heap page and sets the LSN
> d. MarkBufferDirty
>
> If a checkpoint happens between (c) and (d), then we have a problem. The
> fix is easy: just mark the heap buffer dirty first. There's another call
> site that looks like a potential problem, but I don't think it is. I
> simplified the code there to make it (hopefully) more clearly correct.

Applied

> 2. A cleanup patch to pass the buffer_std flag down through
> MarkBufferDirtyHint. This is a matter of preference and purely cosmetic,
> so it might not be wanted. The reason I thought it was useful is that a
> future caller that sets a hint on a non-standard buffer might easily
> miss the assumption that we have a standard buffer.

Skipped that for now. Do we really need it? Can you set a hint on a
non-standard buffer?

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2013-04-30 11:00:13 Re: Remaining beta blockers
Previous Message Simon Riggs 2013-04-30 10:55:29 Re: Substituting Checksum Algorithm (was: Enabling Checksums)