Re: pgsql: Remove the restriction that the relmap must be 512 bytes. - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: pgsql: Remove the restriction that the relmap must be 512 bytes.
Date
Msg-id 20220727184523.n7emhydwhnegd2ci@alvherre.pgsql
Whole thread Raw
In response to Re: pgsql: Remove the restriction that the relmap must be 512 bytes.  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: pgsql: Remove the restriction that the relmap must be 512 bytes.
List pgsql-hackers
On 2022-Jul-27, Robert Haas wrote:

> Hmm, but that doesn't actually produce nice behavior. It just goes
> into an infinite loop, like this:

> 2022-07-27 14:21:12.869 EDT [32853] FATAL:  relation mapping file
> "global/pg_filenode.map" contains invalid data

This seems almost identical what happens without the version number
change, so I wouldn't call it much of an improvement.

> While I agree that changing a version identifier that is more closely
> related to what got changed is better than changing a generic one, I
> think people won't like an infinite loop that spews messages into the
> log at top speed as a way of telling them about the problem.
> 
> So now I'm back to being unsure what to do here.

I vote to go for the catversion bump for now.  

Maybe it's possible to patch the relmapper code afterwards, so that if a
version mismatch is detected the server is stopped with a reasonable
message.  An hypothetical improvement would be to keep the code to read
the old version and upgrade the file automatically, but given the number
of times that this file has changed, it's likely pointless effort.

Therefore, my proposal is to add a comment next to the struct definition
suggesting to bump catversion and call it a day.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/



pgsql-hackers by date:

Previous
From: Robert Treat
Date:
Subject: small windows psqlrc re-wording
Next
From: Alvaro Herrera
Date:
Subject: Re: standby recovery fails (tablespace related) (tentative patch and discussion)