Re: Online enabling of checksums

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Michael Banck <michael(dot)banck(at)credativ(dot)de>
Subject: Re: Online enabling of checksums
Date: 2018-02-28 01:22:44
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> On 28 Feb 2018, at 00:51, Andrey Borodin <x4mmm(at)yandex-team(dot)ru> wrote:
>> 25 февр. 2018 г., в 21:17, Magnus Hagander <magnus(at)hagander(dot)net> написал(а):
>> PFA an updated patch that adds this, and also fixes the problem in pg_verify_checksums spotted by Michael Banck.
> I had to ALLOW_CONNECTIONS to template0 to make it work
> postgres=# 2018-02-27 21:29:05.993 +05 [57259] ERROR: Database template0 does not allow connections.
> Is it a problem with my installation or some regression in the patch?

This is due to a limitation that apply to bgworkers, in order to add checksums
the bgworker must connect to the database and template0 does not allow
connections by default. There is a discussion, and patch, for lifting this
restriction but until this makes it in (if it does), the user will have to
allow connections manually. For reference, the thread for allowing bypassing
allowconn in bgworker is here:

> 2018-02-27 21:40:47.132 +05 [57402] HINT: either disable or enable checksums by calling the pg_data_checksums_enable()/disable() functions
> Function names are wrong in this hint: pg_enable_data_checksums()

Fixed. The format of this hint (and errmsg) is actually also incorrect, which
I fixed while in there.

> The code is nice and clear. One minor spot in the comment
>> This option can only _be_ enabled when data checksums are enabled.


> Is there any way we could provide this functionality for previous versions (9.6,10)? Like implement utility for offline checksum enabling, without WAL-logging, surely.

While outside the scope of the patch in question (since it deals with enabling
checksums online), such a utility should be perfectly possible to write.

Thanks for reviewing!

cheers ./daniel

Attachment Content-Type Size
online_checksums3.diff application/octet-stream 70.8 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-02-28 01:31:49 Re: jsonlog logging only some messages?
Previous Message Amit Langote 2018-02-28 01:12:07 Re: [HACKERS] path toward faster partition pruning