Re: Online checksums patch - once again - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Online checksums patch - once again
Date
Msg-id F7AFCFCD-8F77-4546-8D42-C7F675A4B680@yesql.se
Whole thread Raw
In response to Re: Online checksums patch - once again  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Online checksums patch - once again  (Robert Haas <robertmhaas@gmail.com>)
Re: Online checksums patch - once again  (Justin Pryzby <pryzby@telsasoft.com>)
List pgsql-hackers
> On 22 Jun 2020, at 18:29, Robert Haas <robertmhaas@gmail.com> wrote:
>
> On Mon, Jun 22, 2020 at 8:27 AM Daniel Gustafsson <daniel@yesql.se> wrote:
>> Restartability is implemented by keeping state in pg_class.  I opted for a bool
>> which is cleared as the first step of checksum enable, since it offers fewer
>> synchronization cornercases I think.
>
> Unless you take AccessExclusiveLock on the table, this probably needs
> to be three-valued. Or maybe I am misunderstanding the design...

Sorry being a bit thick, can you elaborate which case you're thinking about?
CREATE TABLE sets the attribute according to the value of data_checksums, and
before enabling checksums (and before changing data_checksums to inprogress)
the bgworker will update all relhaschecksums from true (if any) to false.  Once
the state is set to inprogress all new relations will set relhaschecksums to
true.

The attached v19 fixes a few doc issues I had missed.

cheers ./daniel


Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Why forbid "INSERT INTO t () VALUES ();"
Next
From: Devrim Gündüz
Date:
Subject: CUBE_MAX_DIM