Re: Add checksums without --initdb

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: David Christensen <david(at)endpoint(dot)com>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add checksums without --initdb
Date: 2015-07-02 20:43:17
Message-ID: 5595A265.20508@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 07/02/2015 11:28 PM, Andres Freund wrote:
> On 2015-07-02 22:53:40 +0300, Heikki Linnakangas wrote:
>> Add a "enabling-checksums" mode to the server where it calculates checksums
>> for anything it writes, but doesn't check or complain about incorrect
>> checksums on reads. Put the server into that mode, and then have a
>> background process that reads through all data in the cluster, calculates
>> the checksum for every page, and writes all the data back. Once that's
>> completed, checksums can be fully enabled.
>
> You'd need, afaics, a bgworker that connects to every database to read
> pg_class, to figure out what type of page a relfilenode has. And this
> probably should call back into the relevant AM or such.

Nah, we already assume that every relation data file follows the
standard page format, at least enough to have the checksum field at the
right location. See FlushBuffer() - it just unconditionally calculates
the checksum before writing out the page. (I'm not totally happy about
that, but that ship has sailed)
- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-07-02 20:46:42 Re: Add checksums without --initdb
Previous Message Tom Lane 2015-07-02 20:42:35 Re: [PATCH] two-arg current_setting() with fallback