Skip to content

Commit 3f1e135

Browse files
committed
more verbose errors in twophase
1 parent cbcfff6 commit 3f1e135

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/backend/access/transam/twophase.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,13 +1210,15 @@ ReadTwoPhaseFile(TransactionId xid, bool give_warnings)
12101210
stat.st_size > MaxAllocSize)
12111211
{
12121212
CloseTransientFile(fd);
1213+
fprintf(stderr, "wrong size of two-phase file \"%s\"", path);
12131214
return NULL;
12141215
}
12151216

12161217
crc_offset = stat.st_size - sizeof(pg_crc32c);
12171218
if (crc_offset != MAXALIGN(crc_offset))
12181219
{
12191220
CloseTransientFile(fd);
1221+
fprintf(stderr, "wrong crc offset in two-phase file \"%s\"", path);
12201222
return NULL;
12211223
}
12221224

@@ -1243,6 +1245,7 @@ ReadTwoPhaseFile(TransactionId xid, bool give_warnings)
12431245
if (hdr->magic != TWOPHASE_MAGIC || hdr->total_len != stat.st_size)
12441246
{
12451247
pfree(buf);
1248+
fprintf(stderr, "muggle two-phase file \"%s\": no magic", path);
12461249
return NULL;
12471250
}
12481251

@@ -1255,6 +1258,7 @@ ReadTwoPhaseFile(TransactionId xid, bool give_warnings)
12551258
if (!EQ_CRC32C(calc_crc, file_crc))
12561259
{
12571260
pfree(buf);
1261+
fprintf(stderr, "wrong crc32 in two-phase file \"%s\"", path);
12581262
return NULL;
12591263
}
12601264

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy