Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fe4ec9b

Browse files
committed
Beter error messages about corrupted map
1 parent d9d8d70 commit fe4ec9b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

engine.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ ptrackMapInit(void)
161161
if (stat(ptrack_path, &stat_buf) == 0 &&
162162
stat_buf.st_size != PtrackActualSize)
163163
{
164-
elog(WARNING, "ptrack init: stat_buf.st_size != ptrack_map_size %zu != " UINT64_FORMAT,
165-
(Size) stat_buf.st_size, PtrackActualSize);
164+
elog(WARNING, "ptrack init: unexpected \"%s\" file size %zu != " UINT64_FORMAT ", deleting",
165+
ptrack_path, (Size) stat_buf.st_size, PtrackActualSize);
166166
durable_unlink(ptrack_path, LOG);
167167
}
168168

@@ -242,10 +242,13 @@ ptrackMapInit(void)
242242
elog(DEBUG1, "ptrack init: crc %u, file_crc %u, init_lsn %X/%X",
243243
crc, *file_crc, (uint32) (init_lsn >> 32), (uint32) init_lsn);
244244

245-
/* TODO Handle this error. Probably we can just recreate the file */
245+
/* TODO: Handle this error. Probably we can just recreate the file */
246246
if (!EQ_CRC32C(*file_crc, crc))
247247
{
248-
elog(ERROR, "ptrack init: incorrect checksum of file \"%s\"", ptrack_path);
248+
ereport(ERROR,
249+
(errcode(ERRCODE_DATA_CORRUPTED),
250+
errmsg("ptrack init: incorrect checksum of file \"%s\"", ptrack_path),
251+
errhint("Delete \"%s\" and start the server again.", ptrack_path)));
249252
}
250253
}
251254
else

0 commit comments

Comments
 (0)