Re: corrupt pages detected by enabling checksums - Mailing list pgsql-hackers

From Greg Smith
Subject Re: corrupt pages detected by enabling checksums
Date
Msg-id 518DBB87.6060805@2ndQuadrant.com
Whole thread Raw
In response to Re: corrupt pages detected by enabling checksums  (Simon Riggs <simon@2ndQuadrant.com>)
List 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@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Re: [GENERAL] pg_upgrade fails, "mismatch of relation OID" - 9.1.9 to 9.2.4
Next
From: Amit kapila
Date:
Subject: Re: corrupt pages detected by enabling checksums