Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc9c401a

Browse files
committed
Improve error messages for some callers of XLogReadRecord()
A couple of code paths related to logical decoding (WAL sender, slotadvancing, etc.) use XLogReadRecord(), feeding on error messagesgenerated by walreader.c on a failure. All those messages have nocontext, making it harder to spot from where an error could come even ifthese should not happen. All the other callers of XLogReadRecord() dothat already.Reviewed-by: Kyotaro HoriguchiDiscussion:https://postgr.es/m/YYnTH6OyOwQcAdkw@paquier.xyz
1 parent4168a47 commitc9c401a

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

‎src/backend/replication/logical/logical.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,9 +605,9 @@ DecodingContextFindStartpoint(LogicalDecodingContext *ctx)
605605
/* the read_page callback waits for new WAL */
606606
record=XLogReadRecord(ctx->reader,&err);
607607
if (err)
608-
elog(ERROR,"%s",err);
608+
elog(ERROR,"could not find logical decoding starting point:%s",err);
609609
if (!record)
610-
elog(ERROR,"no record found");/* shouldn't happen */
610+
elog(ERROR,"could not find logical decoding starting point");
611611

612612
LogicalDecodingProcessRecord(ctx,ctx->reader);
613613

‎src/backend/replication/logical/logicalfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ pg_logical_slot_get_changes_guts(FunctionCallInfo fcinfo, bool confirm, bool bin
276276

277277
record=XLogReadRecord(ctx->reader,&errm);
278278
if (errm)
279-
elog(ERROR,"%s",errm);
279+
elog(ERROR,"could not find record for logical decoding:%s",errm);
280280

281281
/*
282282
* The {begin_txn,change,commit_txn}_wrapper callbacks above will

‎src/backend/replication/slotfuncs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,8 @@ pg_logical_replication_slot_advance(XLogRecPtr moveto)
529529
*/
530530
record=XLogReadRecord(ctx->reader,&errm);
531531
if (errm)
532-
elog(ERROR,"%s",errm);
532+
elog(ERROR,"could not find record while advancing replication slot: %s",
533+
errm);
533534

534535
/*
535536
* Process the record. Storage-level changes are ignored in

‎src/backend/replication/walsender.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2979,7 +2979,8 @@ XLogSendLogical(void)
29792979

29802980
/* xlog record was invalid */
29812981
if (errm!=NULL)
2982-
elog(ERROR,"%s",errm);
2982+
elog(ERROR,"could not find record while sending logically-decoded data: %s",
2983+
errm);
29832984

29842985
if (record!=NULL)
29852986
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp