summaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/logical.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-11-10 12:00:33 +0900
committerMichael Paquier <michael@paquier.xyz>2021-11-10 12:00:33 +0900
commitc9c401a5e13accc4a3a775e3feeabdc5940c9178 (patch)
treec616ef270413dfa847f4e97483f23ef4c694e14f /src/backend/replication/logical/logical.c
parent4168a4745492cd54a0ffffc271b452525ef4dc60 (diff)
Improve error messages for some callers of XLogReadRecord()
A couple of code paths related to logical decoding (WAL sender, slot advancing, etc.) use XLogReadRecord(), feeding on error messages generated by walreader.c on a failure. All those messages have no context, making it harder to spot from where an error could come even if these should not happen. All the other callers of XLogReadRecord() do that already. Reviewed-by: Kyotaro Horiguchi Discussion: https://postgr.es/m/YYnTH6OyOwQcAdkw@paquier.xyz
Diffstat (limited to 'src/backend/replication/logical/logical.c')
-rw-r--r--src/backend/replication/logical/logical.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c
index aae0ae5b8aa..b7d95215764 100644
--- a/src/backend/replication/logical/logical.c
+++ b/src/backend/replication/logical/logical.c
@@ -605,9 +605,9 @@ DecodingContextFindStartpoint(LogicalDecodingContext *ctx)
/* the read_page callback waits for new WAL */
record = XLogReadRecord(ctx->reader, &err);
if (err)
- elog(ERROR, "%s", err);
+ elog(ERROR, "could not find logical decoding starting point: %s", err);
if (!record)
- elog(ERROR, "no record found"); /* shouldn't happen */
+ elog(ERROR, "could not find logical decoding starting point");
LogicalDecodingProcessRecord(ctx, ctx->reader);