summaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/snapbuild.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/replication/logical/snapbuild.c')
-rw-r--r--src/backend/replication/logical/snapbuild.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c
index 7bd969b0a1c..1359d9b20a3 100644
--- a/src/backend/replication/logical/snapbuild.c
+++ b/src/backend/replication/logical/snapbuild.c
@@ -1736,7 +1736,8 @@ SnapBuildRestore(SnapBuild *builder, XLogRecPtr lsn)
}
else
ereport(ERROR,
- (errmsg("could not read file \"%s\": read %d of %zu",
+ (errcode(ERRCODE_DATA_CORRUPTED),
+ errmsg("could not read file \"%s\": read %d of %zu",
path, readBytes,
(Size) SnapBuildOnDiskConstantSize)));
}
@@ -1775,7 +1776,8 @@ SnapBuildRestore(SnapBuild *builder, XLogRecPtr lsn)
}
else
ereport(ERROR,
- (errmsg("could not read file \"%s\": read %d of %zu",
+ (errcode(ERRCODE_DATA_CORRUPTED),
+ errmsg("could not read file \"%s\": read %d of %zu",
path, readBytes, sizeof(SnapBuild))));
}
COMP_CRC32C(checksum, &ondisk.builder, sizeof(SnapBuild));
@@ -1802,7 +1804,8 @@ SnapBuildRestore(SnapBuild *builder, XLogRecPtr lsn)
}
else
ereport(ERROR,
- (errmsg("could not read file \"%s\": read %d of %zu",
+ (errcode(ERRCODE_DATA_CORRUPTED),
+ errmsg("could not read file \"%s\": read %d of %zu",
path, readBytes, sz)));
}
COMP_CRC32C(checksum, ondisk.builder.was_running.was_xip, sz);
@@ -1828,7 +1831,8 @@ SnapBuildRestore(SnapBuild *builder, XLogRecPtr lsn)
}
else
ereport(ERROR,
- (errmsg("could not read file \"%s\": read %d of %zu",
+ (errcode(ERRCODE_DATA_CORRUPTED),
+ errmsg("could not read file \"%s\": read %d of %zu",
path, readBytes, sz)));
}
COMP_CRC32C(checksum, ondisk.builder.committed.xip, sz);