Skip to content

Commit 4865bca

Browse files
Amit Kapilapull[bot]
authored andcommitted
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 9655fa2 commit 4865bca

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
@@ -2039,7 +2039,7 @@ SnapBuildRestoreContents(int fd, char *dest, Size size, const char *path)
20392039
ereport(ERROR,
20402040
(errcode(ERRCODE_DATA_CORRUPTED),
20412041
errmsg("could not read file \"%s\": read %d of %zu",
2042-
path, readBytes, sizeof(SnapBuild))));
2042+
path, readBytes, size)));
20432043
}
20442044
}
20452045

0 commit comments

Comments
 (0)