Re: Offline enabling/disabling of data checksums
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Michael Banck <michael.banck@credativ.de>, Postgres hackers <pgsql-hackers@postgresql.org>
Date: 2019-03-17T12:34:36Z
Lists: pgsql-hackers
On Sun, Mar 17, 2019 at 12:44:39PM +0100, Fabien COELHO wrote: > I could remove the two "catalog/" includes from pg_resetwal, I assume that > you meant these ones. Not exactly. What I meant is that if you try to call directly fsync_fname and fsync_parent_path from file_utils.h, then you get into trouble because of xlog.h.. Sure you can remove also the ones you removed. > Hmmm. I just did that, but what about just a boolean? What other options > could be required? Maybe some locking/checking? It is already expected from the caller to properly take ControlFileLock. Note I tend to worry too much about the extensibility of published APIs these days as well, so perhaps just a boolean would be fine, please let me reconsider that after some sleep, and it is not like the contents of this routine are going to become much complicated either, except potentially to control the flags on open(). :p > I kept the initial no-parameter function which calls the new one with 4 > parameters, though, because it looks more homogeneous this way in the > backend code. This is debatable. True, this actually makes back-patching a bit easier, and there are 13 calls of UpdateControlFile(). > Attached is an update. Thanks, I'll take a look at that tomorrow. You have one error at the end of update_controlfile(), where close() could issue a frontend-like error for the backend, calling exit() on the way. That's not good. (No need to send a new patch, I'll fix it myself.) -- Michael
Commits
-
Reorganize Notes section in documentation of pg_checksums
- a7cc52370b2b 12.0 landed
-
Add option -N/--no-sync to pg_checksums
- e0090c869008 12.0 landed
-
Add options to enable and disable checksums in pg_checksums
- ed308d783790 12.0 landed
-
Refactor more code logic to update the control file
- 8b938d36f744 12.0 landed
-
Rename pg_verify_checksums to pg_checksums
- 6dd263cfaa84 12.0 landed
-
Fix cross-version compatibility checks of pg_verify_checksums
- 501f58359b59 11.3 landed
- c9ae7f704c67 12.0 landed
-
Add routine able to update the control file to src/common/
- ce6afc6823fb 12.0 landed