Streaming Replication Protocol and Logical Replication

From: Greg Rychlewski <greg(dot)rychlewski(at)gmail(dot)com>
To: pgsql-novice(at)lists(dot)postgresql(dot)org
Subject: Streaming Replication Protocol and Logical Replication
Date: 2021-12-10 19:23:50
Message-ID: CAKemG7Wn1tUQ9QccSGnz_BdUmqhWAUWnha4DpNijbK_4dbc7eQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-novice by date

  From Date Subject
Next Message Alex R 2021-12-16 15:56:48 JSONpath query that returns paths to the matches
Previous Message Simon Riggs 2021-12-09 12:47:47 Re: Table-Level Locks and Transactions