Re: Offline enabling/disabling of data checksums

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Michael Banck <michael(dot)banck(at)credativ(dot)de>, Postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Offline enabling/disabling of data checksums
Date: 2019-03-17 09:01:20
Message-ID: alpine.DEB.2.21.1903170935210.2506@lancre
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers


Bonjour Michaël-san,

> Yes, that would be nice, for now I have focused. For pg_resetwal yes
> we could do it easily. Would you like to send a patch?

Here is a proposal for "pg_resetwal".

The implementation basically removes a lot of copy paste and calls the
new update_controlfile function instead. I like removing useless code:-)

The reserwal implementation was doing a rm/create cycle, which was leaving
a small window for losing the controlfile. Not neat.

I do not see the value of *not* fsyncing the control file when writing it,
as it is by definition very precious, so I added a fsync. The server side
branch uses the backend available "pg_fsync", which complies with server
settings there and can do nothing if fsync is disabled.

Maybe the two changes could be committed separately.

--
Fabien.

Attachment Content-Type Size
controlfile-update-1.patch text/x-diff 3.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-03-17 09:10:45 Re: Make pg_checksums complain if compiled BLCKSZ and data folder's block size differ
Previous Message Michael Paquier 2019-03-17 08:25:10 Re: Make pg_checksums complain if compiled BLCKSZ and data folder's block size differ