Streaming Replication Protocol and Logical Replication - Mailing list pgsql-novice

From Greg Rychlewski
Subject Streaming Replication Protocol and Logical Replication
Date
Msg-id CAKemG7Wn1tUQ9QccSGnz_BdUmqhWAUWnha4DpNijbK_4dbc7eQ@mail.gmail.com
Whole thread Raw
List pgsql-novice
Hi,

I am writing something to interpret the XLogData messages sent during logical replication. I want to record the position of the WAL records I have previously processed so that if I need to restart replication I can skip to the first WAL record I haven't processed.

If I'm understanding the documentation correctly, adding the 2 values below will give me the latest byte offset I have processed. So adding 1 to their sum will tell me where I can start replication.

1. Int64 - The starting point of the WAL data in this message.
2. Byten - A section of the WAL data stream.

So my questions are:
1. Assuming no continuation records, is my understanding above correct?
2. If there are continuation records, do those have the same "starting point of WAL data in this message" as the main record? If yes, is there some way to use the protocol to determine when messages are continuations of each other?

Thank you

pgsql-novice by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Table-Level Locks and Transactions
Next
From: Alex R
Date:
Subject: JSONpath query that returns paths to the matches