Re: corrupt pages detected by enabling checksums

From: Greg Smith <greg(at)2ndQuadrant(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Greg Stark <stark(at)mit(dot)edu>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jim Nasby <jim(at)nasby(dot)net>, Jeff Davis <pgsql(at)j-davis(dot)com>, Florian Pflug <fgp(at)phlo(dot)org>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(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-05-11 03:31:19
Message-ID: 518DBB87.6060805@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5/10/13 1:32 PM, Simon Riggs wrote:
> The timing
> window between the write and the sync is negligible and yet I/O would
> need to occur in that window and also be out of order from the order
> of the write, which is unlikely because an I/O elevator would either
> not touch the order of writes at all, or would want to maintain
> sequential order to avoid head movement, which is what we want. I
> guess we should add here "...with disks, maybe not with SSDs".

It's not really safe to make any assumptions about I/O elevators.
Reordering gets done from the perspective of the last item written.
When the previous write was at the logical end of the disk, it can just
as easily re-order a queue of writes in the complete reverse order they
were issued in.

The only way you can ever get a useful guarantee is when an fsync
returns completion. Writes can effectively go out in a completely
random order until that point. All you can rely on is throwing up a
stop sign that says "tell me when all of them are done". In between
those, you have no idea of the ordering.

--
Greg Smith 2ndQuadrant US greg(at)2ndQuadrant(dot)com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit kapila 2013-05-11 03:33:15 Re: corrupt pages detected by enabling checksums
Previous Message Bruce Momjian 2013-05-11 00:03:38 Re: Re: [GENERAL] pg_upgrade fails, "mismatch of relation OID" - 9.1.9 to 9.2.4