Skip to content

Commit 13e2665

Browse files
author
Amit Kapila
committed
Fix the error message when failing to restore the snapshot.
The SnapBuildRestoreContents() used a const value in the error message to indicate the size in bytes it was expecting to read from the serialized snapshot file. Fix it by reporting the size that was actually passed. Author: Hou Zhijie Reviewed-by: Amit Kapila Backpatch-through: 16 Discussion: http://postgr.es/m/OS0PR01MB5716D408364F7DF32221C08D941FA@OS0PR01MB5716.jpnprd01.prod.outlook.com
1 parent 8179d1b commit 13e2665

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/replication/logical/snapbuild.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2034,7 +2034,7 @@ SnapBuildRestoreContents(int fd, char *dest, Size size, const char *path)
20342034
ereport(ERROR,
20352035
(errcode(ERRCODE_DATA_CORRUPTED),
20362036
errmsg("could not read file \"%s\": read %d of %zu",
2037-
path, readBytes, sizeof(SnapBuild))));
2037+
path, readBytes, size)));
20382038
}
20392039
}
20402040

0 commit comments

Comments
 (0)