Re: [HACKERS] Checksums by default? - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: [HACKERS] Checksums by default?
Date
Msg-id 20170126003240.GA9812@tamriel.snowman.net
Whole thread Raw
In response to Re: [HACKERS] Checksums by default?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] Checksums by default?  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
* Robert Haas (robertmhaas@gmail.com) wrote:
> On Wed, Jan 25, 2017 at 7:19 PM, Michael Paquier
> <michael.paquier@gmail.com> wrote:
> > On Thu, Jan 26, 2017 at 9:14 AM, Peter Geoghegan <pg@heroku.com> wrote:
> >> On Wed, Jan 25, 2017 at 3:30 PM, Stephen Frost <sfrost@snowman.net> wrote:
> >>> As it is, there are backup solutions which *do* check the checksum when
> >>> backing up PG.  This is no longer, thankfully, some hypothetical thing,
> >>> but something which really exists and will hopefully keep users from
> >>> losing data.
> >>
> >> Wouldn't that have issues with torn pages?
> >
> > Why? What do you foresee here? I would think such backup solutions are
> > careful enough to ensure correctly the durability of pages so as they
> > are not partially written.
>
> Well, you'd have to keep a read(fd, buf, 8192) performed by the backup
> tool from overlapping with a write(fd, buf, 8192) performed by the
> backend.

As Michael mentioned, that'd depend on if things are atomic from a
user's perspective at certain sizes (perhaps 4k, which wouldn't be too
surprising, but may also be system-dependent), in which case verifying
that the page is in the WAL would be sufficient.

Thanks!

Stephen

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [HACKERS] Checksums by default?
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] Checksums by default?