diff options
Diffstat (limited to 'src/backend/replication/logical/logical.c')
-rw-r--r-- | src/backend/replication/logical/logical.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c index bdf4389a57c..cf932006188 100644 --- a/src/backend/replication/logical/logical.c +++ b/src/backend/replication/logical/logical.c @@ -461,11 +461,10 @@ DecodingContextReady(LogicalDecodingContext *ctx) void DecodingContextFindStartpoint(LogicalDecodingContext *ctx) { - XLogRecPtr startptr; ReplicationSlot *slot = ctx->slot; /* Initialize from where to start reading WAL. */ - startptr = slot->data.restart_lsn; + XLogBeginRead(ctx->reader, slot->data.restart_lsn); elog(DEBUG1, "searching for logical decoding starting point, starting at %X/%X", (uint32) (slot->data.restart_lsn >> 32), @@ -478,14 +477,12 @@ DecodingContextFindStartpoint(LogicalDecodingContext *ctx) char *err = NULL; /* the read_page callback waits for new WAL */ - record = XLogReadRecord(ctx->reader, startptr, &err); + record = XLogReadRecord(ctx->reader, &err); if (err) elog(ERROR, "%s", err); if (!record) elog(ERROR, "no record found"); /* shouldn't happen */ - startptr = InvalidXLogRecPtr; - LogicalDecodingProcessRecord(ctx, ctx->reader); /* only continue till we found a consistent spot */ |