Skip to content

Commit 3ab1107

Browse files
committed
[PGPRO-5691] remove pg_probackup tests workarounds
See postgrespro/pg_probackup#471
1 parent 2a148c5 commit 3ab1107

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

engine.c

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -209,20 +209,10 @@ ptrackMapReadFromFile(const char *ptrack_path)
209209

210210
if (!EQ_CRC32C(*file_crc, crc))
211211
{
212-
/*
213-
* This is ERROR now, because tests.ptrack.PtrackTest.test_corrupt_ptrack_map
214-
* threats this as error with exact error message
215-
* see https://github.com/postgrespro/pg_probackup/blob/a454bd7d63e1329b2c46db6a71aa263ac7621cc6/tests/ptrack.py#L4378
216-
*/
217-
/*ereport(WARNING,
212+
ereport(WARNING,
218213
(errcode(ERRCODE_DATA_CORRUPTED),
219214
errmsg("ptrack read map: incorrect checksum of file \"%s\"", ptrack_path),
220215
errdetail("Deleting file \"%s\" and reinitializing ptrack map.", ptrack_path)));
221-
*/
222-
ereport(ERROR,
223-
(errcode(ERRCODE_DATA_CORRUPTED),
224-
errmsg("ptrack init: incorrect checksum of file \"%s\"", ptrack_path),
225-
errdetail("Deleting file \"%s\" and reinitializing ptrack map.", ptrack_path)));
226216
return false;
227217
}
228218
}
@@ -301,21 +291,6 @@ ptrackMapInit(void)
301291
* so leave it as it is
302292
*/
303293
}
304-
305-
/*
306-
* Very ugly fix:
307-
* create empty old mmap'ed file to make tests.ptrack.PtrackTest.test_corrupt_ptrack_map happy
308-
* see https://github.com/postgrespro/pg_probackup/blob/a454bd7d63e1329b2c46db6a71aa263ac7621cc6/tests/ptrack.py#L4341
309-
*
310-
* TODO: remove this shit
311-
*/
312-
elog(WARNING, "ptrack init: not production ready code!");
313-
{
314-
char old_file[MAXPGPATH];
315-
sprintf(old_file, "%s/global/ptrack.map.mmap", DataDir);
316-
unlink(old_file);
317-
copy_file("/dev/null", old_file);
318-
}
319294
}
320295

321296
/*

0 commit comments

Comments
 (0)