1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-03-17 21:18:00 +02:00

pg_control: fix reading of pg_control of vanilla in pg_controldata

Do not change the CRC as this makes its check senseless. Instead, read the
pg_control of vanilla to the pg_control strcucture of vanilla
(ControlFileDataOriginal) and print its values as is done in vanilla.

Thanks to Arthur Zakirov for reporting this.

Also: fix checking of byte ordering mismatch of pg_control in pg_probackup.
This commit is contained in:
Marina Polyakova 2018-11-02 15:47:15 +03:00
parent 908efc3e3d
commit 078d341bb8

View File

@ -71,7 +71,8 @@ checkControlFile(ControlFileData *ControlFile)
"Either the file is corrupt, or it has a different layout than this program\n"
"is expecting. The results below are untrustworthy.");
if (ControlFile->pg_control_version % 65536 == 0 && ControlFile->pg_control_version / 65536 != 0)
if ((ControlFile->pg_control_version % 65536 == 0 || ControlFile->pg_control_version % 65536 > 10000) &&
ControlFile->pg_control_version / 65536 != 0)
elog(ERROR, "possible byte ordering mismatch\n"
"The byte ordering used to store the pg_control file might not match the one\n"
"used by this program. In that case the results below would be incorrect, and\n"