Skip to content

Commit 58d02b2

Browse files
committed
[Issue #248] Use crc32 when validating backup of version "2.0.21 < version <= 2.0.25"
1 parent 6975492 commit 58d02b2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/validate.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,8 @@ validate_tablespace_map(pgBackup *backup)
716716
pgFile **tablespace_map = NULL;
717717
pg_crc32 crc;
718718
parray *files = get_backup_filelist(backup, true);
719+
bool use_crc32c = parse_program_version(backup->program_version) <= 20021 ||
720+
parse_program_version(backup->program_version) >= 20025;
719721

720722
parray_qsort(files, pgFileCompareRelPathWithExternal);
721723
join_path_components(map_path, backup->database_dir, PG_TABLESPACE_MAP_FILE);
@@ -738,7 +740,7 @@ validate_tablespace_map(pgBackup *backup)
738740
map_path, base36enc(backup->backup_id));
739741

740742
/* check tablespace map checksumms */
741-
crc = pgFileGetCRC(map_path, true, false);
743+
crc = pgFileGetCRC(map_path, use_crc32c, false);
742744

743745
if ((*tablespace_map)->crc != crc)
744746
elog(ERROR, "Invalid CRC of tablespace map file \"%s\" : %X. Expected %X, "

0 commit comments

Comments
 (0)