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

From Robert Haas
Subject Re: Online checksums patch - once again
Date
Msg-id CA+Tgmoa_WTE6WGn7P05TeOCRO82d+mVg+TaLSe0xjd56WhOQmA@mail.gmail.com
Whole thread Raw
In response to Re: Online checksums patch - once again  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Online checksums patch - once again  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers
On Sat, Jan 18, 2020 at 6:18 PM Daniel Gustafsson <daniel@yesql.se> wrote:
> Thanks again for reviewing (and working on the infrastructure required for this
> patch to begin with)!  Regarding the persisting the progress; that would be a
> really neat feature but I don't have any suggestion on how to do that safely
> for real use-cases.

Leaving to one side the question of how much work is involved, could
we do something conceptually similar to relfrozenxid/datfrozenxid,
i.e. use catalog state to keep track of which objects have been
handled and which not?

Very rough sketch:

* set a flag indicating that checksums must be computed for all page writes
* use barriers and other magic to make sure everyone has gotten the
memo from the previous step
* use new catalog fields pg_class.relhaschecksums and
pg_database.dathaschecksums to track whether checksums are enabled
* keep launching workers for databases where !pg_class.dathaschecksums
until none remain
* mark checksums as fully enabled
* party

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: Greatest Common Divisor
Next
From: Alexander Kukushkin
Date:
Subject: Re: Increase psql's password buffer size