Re: Online enabling of page level checksums

From: David Christensen <david(at)endpoint(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: Online enabling of page level checksums
Date: 2017-01-23 19:11:20
Message-ID: F58EC0B4-F6A5-4271-8D1E-80E758DD246F@endpoint.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> On Jan 23, 2017, at 10:59 AM, David Christensen <david(at)endpoint(dot)com> wrote:
>
>>
>> On Jan 23, 2017, at 10:53 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>>
>> On 23 January 2017 at 16:32, David Christensen <david(at)endpoint(dot)com> wrote:
>>
>>> ** Handling checksums on a standby:
>>>
>>> How to handle checksums on a standby is a bit trickier since checksums are inherently a local cluster state and not WAL logged but we are storing state in the system tables for each database we need to make sure that the replicas reflect truthful state for the checksums for the cluster.
>>
>> Not WAL logged? If the objective of this feature is robustness, it
>> will need to be WAL logged.
>>
>> Relation options aren't accessed by the startup process during
>> recovery, so that part won't work in recovery. Perhaps disable
>> checksumming until the everything is enabled rather than relation by
>> relation.
>>
>> If y'all serious about this then you're pretty late in the cycle for
>> such a huge/critical patch. So lets think of ways of reducing the
>> complexity...
>>
>> Seems most sensible to add the "enable checksums for table" function
>> into VACUUM because then it will happen automatically via autovacuum,
>> or you could force the issue using something like
>> vacuumdb --jobs 4 --enable-checksums
>> That gives you vacuum_delay and a background worker for no effort
>
> I’m not sure that this will work as-is, unless we’re forcing VACUUM to ignore the visibility map. I had originally considered having this sit on top of VACUUm though, we just need a way to iterate over all relations and read every page.

Another issue with this (that I think would still exist with the bgworker approach) is how to handle databases with datallowconn = 0. `vacuumdb`, at least, explicitly filters out these rows when iterating over databases to connect to, so while we could enable them for all databases, we can’t enable for the cluster without verifying that these disallowed dbs are already checksummed.
--
David Christensen
End Point Corporation
david(at)endpoint(dot)com
785-727-1171

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-01-23 19:36:00 Re: [PATCH] Generic type subscription
Previous Message Tom Lane 2017-01-23 19:07:44 Re: [PATCH] Generic type subscription