Thread: When should we bump the logical replication protocol version?

When should we bump the logical replication protocol version?

From
"houzj.fnst@fujitsu.com"
Date:
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