Re: Online enabling of checksums - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Online enabling of checksums
Date
Msg-id BBA1AF92-640C-4249-A5A6-14463CCC438C@yesql.se
Whole thread Raw
In response to Re: Online enabling of checksums  (Andrey Borodin <x4mmm@yandex-team.ru>)
Responses Re: Online enabling of checksums
List pgsql-hackers
> On 28 Feb 2018, at 00:51, Andrey Borodin <x4mmm@yandex-team.ru> wrote:
>
>> 25 февр. 2018 г., в 21:17, Magnus Hagander <magnus@hagander.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:

https://www.postgresql.org/message-id/CABUevEwWT9ZmonBMRFF0owneoN3DAPgOVzwHAN0bUkxaqY3eNQ@mail.gmail.com

> 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.

Fixed.

> Is there any way we could provide this functionality for previous versions (9.6,10)? Like implement utility for
offlinechecksum 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

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: [HACKERS] path toward faster partition pruning
Next
From: Michael Paquier
Date:
Subject: Re: jsonlog logging only some messages?