Re: Make pg_checksums complain if compiled BLCKSZ and data folder's block size differ

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Magnus Hagander <magnus(at)hagander(dot)net>, Michael Banck <michael(dot)banck(at)credativ(dot)de>, Sergei Kornilov <sk(at)zsrv(dot)org>
Subject: Re: Make pg_checksums complain if compiled BLCKSZ and data folder's block size differ
Date: 2019-03-17 05:46:57
Message-ID: 20190317054657.GA3357@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Mar 16, 2019 at 09:18:34AM +0100, Fabien COELHO wrote:
>> If the block size the tool is compiled with does not match the data
>> folder block size, then users would get incorrect checksums failures,
>
> Or worse, incorrect checksump writing under "enabling"?

Let's hope that we make that possible for v12. We'll see.

> Second line is missing a "\n". "pg_checksums" does not need to appear, it is
> already the progname, and if it differs there is no point in giving a wrong
> name. I think it could be shorter. What about:

Something like "%s: database folder is incompatible" for the first
line sounds kind of better per the feedback gathered. And then on the
second line:
"The database cluster was initialized with block size %u, but
pg_checksums was compiled with block size %u."

> I think it would be better to adapt the checksum computation, but this is
> indeed non trivial because of the way the BLCKSZ constant is hardwired into
> type declarations.

That's actually the possibility I was pointing out upthread. I am not
sure that the use cases are worth the effort though.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2019-03-17 07:13:08 Re: jsonpath
Previous Message Arseny Sher 2019-03-17 04:53:35 Re: Parallel query vs smart shutdown and Postmaster death