When should we bump the logical replication protocol version?

From: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: When should we bump the logical replication protocol version?
Date: 2022-09-09 05:11:03
Message-ID: OS0PR01MB571662ED6D4E6164B7D1E4D294439@OS0PR01MB5716.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

When implementing the feature to perform streaming logical transactions by
background workers[1], we plan to extend the LOGICAL_REP_MSG_STREAM_ABORT message
to send the additional "abort_lsn" and "abort_time" so that we can advance the
origin lsn in subscriber and can restart streaming from correct position in
case of crash.

Since the LOGICAL_REP_MSG_STREAM_ABORT message is changed, we planned to bump
the logical replication protocol version. But when reviewing the code, we feel
it can also work without using a new protocol version if we check the
new streaming option value called('parallel'). On publisher, we can check if
the streaming option is set the new value('parallel') and only send extra abort
information in this case.

I think it's reasonable to bump the protocol version number if we change any
protocol message even if we only add some new fields to the existing message,
and that's what we've always done.

The only personal concern is that I didn't find any documentation that clearly
stated the standard about when to bump logical replication protocol version,
which makes me a little unsure if this is the right thing to do.

So, I'd like to confirm is it OK to modify or add some fields without bumping
the protocol version ? Or it's a standard to bump it if we change any
protocol message.

Any hints will be appreciated.

[1] https://www.postgresql.org/message-id/CAA4eK1%2BwyN6zpaHUkCLorEWNx75MG0xhMwcFhvjqm2KURZEAGw%40mail.gmail.com

Best regards,
Hou zj

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2022-09-09 05:16:17 Re: Switching XLog source from archive to streaming when primary available
Previous Message Thomas Munro 2022-09-09 04:36:55 Re: pg15b3: recovery fails with wal prefetch enabled