diff options
Diffstat (limited to 'src/backend/replication/slotfuncs.c')
-rw-r--r-- | src/backend/replication/slotfuncs.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/backend/replication/slotfuncs.c b/src/backend/replication/slotfuncs.c index 7ab0b804e4c..d9d36879ed7 100644 --- a/src/backend/replication/slotfuncs.c +++ b/src/backend/replication/slotfuncs.c @@ -153,8 +153,9 @@ create_logical_replication_slot(char *name, char *plugin, ctx = CreateInitDecodingContext(plugin, NIL, false, /* just catalogs is OK */ restart_lsn, - read_local_xlog_page, - wal_segment_close, + XL_ROUTINE(.page_read = read_local_xlog_page, + .segment_open = wal_segment_open, + .segment_close = wal_segment_close), NULL, NULL, NULL); /* @@ -511,8 +512,9 @@ pg_logical_replication_slot_advance(XLogRecPtr moveto) ctx = CreateDecodingContext(InvalidXLogRecPtr, NIL, true, /* fast_forward */ - read_local_xlog_page, - wal_segment_close, + XL_ROUTINE(.page_read = read_local_xlog_page, + .segment_open = wal_segment_open, + .segment_close = wal_segment_close), NULL, NULL, NULL); /* @@ -534,13 +536,7 @@ pg_logical_replication_slot_advance(XLogRecPtr moveto) * Read records. No changes are generated in fast_forward mode, * but snapbuilder/slot statuses are updated properly. */ - while (XLogReadRecord(ctx->reader, &record, &errm) == - XLREAD_NEED_DATA) - { - if (!ctx->page_read(ctx->reader)) - break; - } - + record = XLogReadRecord(ctx->reader, &errm); if (errm) elog(ERROR, "%s", errm); |