On 10/11/2025 18:38, Heikki Linnakangas wrote:
> On 10/11/2025 17:16, Tom Lane wrote:
>> Heikki Linnakangas <hlinnaka@iki.fi> writes:
>>> Committed. Thanks for the quick review!
>>
>> I think the number this should have bumped is PG_CONTROL_VERSION
>> (thanks to the new field therein). Bumping CATALOG_VERSION_NO
>> seems quite beside the point.
>
> Ah thanks, I forgot we have that as a separate version number. I'll go
> bump that now. (I will not try to revert the CATALOG_VERSION_NO change,
> that would be very confusing.)
Fixed. And I just noticed another thing I forgot: pg_resetwal and
pg_controldata.
While testing, I noticed that pg_controldata doesn't check
PG_CONTROL_VERSION. If you add a field to ControlFileData that changes
the length, you'll get a warning that the CRC doesn't match:
> pg_controldata: warning: calculated CRC checksum does not match value stored in control file
> pg_controldata: detail: Either the control file is corrupt, or it has a different layout than this program is
expecting. The results below are untrustworthy.
but if you make any changes that *don't* change ControlFileData's size,
pg_controldata will merrily try to interpret the values with no warning.
Surely it should also check PG_CONTROL_VERSION?
- Heikki