When should we bump the logical replication protocol version? - Mailing list pgsql-hackers

From houzj.fnst@fujitsu.com
Subject When should we bump the logical replication protocol version?
Date
Msg-id OS0PR01MB571662ED6D4E6164B7D1E4D294439@OS0PR01MB5716.jpnprd01.prod.outlook.com
Whole thread Raw
List 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



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: pg15b3: recovery fails with wal prefetch enabled
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: Switching XLog source from archive to streaming when primary available