Re: pgsql: Remove the restriction that the relmap must be 512 bytes.

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Remove the restriction that the relmap must be 512 bytes.
Date: 2022-07-27 18:24:23
Message-ID: CA+TgmobUHsQ7orynyuZaDyf7=o6H66SUTDN0ZtMxGzqiXTSpDA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Wed, Jul 27, 2022 at 2:13 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Wed, Jul 27, 2022 at 1:42 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > If there's a magic number, then I'd (a) change that and (b) adjust
> > whatever comments led you to think you shouldn't. Bumping catversion
> > is a good fallback choice when there's not any more-proximate version
> > indicator, but here there is.
>
> Maybe I just got cold feet because it doesn't ever have seem to have
> been changed before, because the definition says:
>
> #define RELMAPPER_FILEMAGIC 0x592717 /* version ID value */
>
> And the fact that "version" is in there sure makes it seem like a
> version number, now that I look again.
>
> I'll add 1 to the value.

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

2022-07-27 14:21:12.826 EDT [32849] LOG: database system was
interrupted; last known up at 2022-07-27 14:21:12 EDT
2022-07-27 14:21:12.860 EDT [32849] LOG: database system was not
properly shut down; automatic recovery in progress
2022-07-27 14:21:12.861 EDT [32849] LOG: invalid record length at
0/14B3BB8: wanted 24, got 0
2022-07-27 14:21:12.861 EDT [32849] LOG: redo is not required
2022-07-27 14:21:12.864 EDT [32850] LOG: checkpoint starting:
end-of-recovery immediate wait
2022-07-27 14:21:12.865 EDT [32850] LOG: checkpoint complete: wrote 3
buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled;
write=0.001 s, sync=0.001 s, total=0.002 s; sync files=2,
longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB;
lsn=0/14B3BB8, redo lsn=0/14B3BB8
2022-07-27 14:21:12.868 EDT [31930] LOG: database system is ready to
accept connections
2022-07-27 14:21:12.869 EDT [32853] FATAL: relation mapping file
"global/pg_filenode.map" contains invalid data
2022-07-27 14:21:12.869 EDT [32854] FATAL: relation mapping file
"global/pg_filenode.map" contains invalid data
2022-07-27 14:21:12.870 EDT [31930] LOG: autovacuum launcher process
(PID 32853) exited with exit code 1
2022-07-27 14:21:12.870 EDT [31930] LOG: terminating any other active
server processes
2022-07-27 14:21:12.870 EDT [31930] LOG: background worker "logical
replication launcher" (PID 32854) exited with exit code 1
2022-07-27 14:21:12.871 EDT [31930] LOG: all server processes
terminated; reinitializing

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.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2022-07-27 18:45:23 Re: pgsql: Remove the restriction that the relmap must be 512 bytes.
Previous Message Robert Haas 2022-07-27 18:13:57 Re: pgsql: Remove the restriction that the relmap must be 512 bytes.

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2022-07-27 18:42:11 small windows psqlrc re-wording
Previous Message Tom Lane 2022-07-27 18:22:20 Re: Hash index build performance tweak from sorting