Using logical replication with older version subscribers

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Using logical replication with older version subscribers
Date: 2019-01-07 08:00:21
Message-ID: CAD21AoDeRCWAO3nzvesgQg4bXksGsJ5gTGmYpG-QNOcH=SvTeg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Logical replication enables us to replicate data changes to different
major version PostgreSQL as the doc says[1]. However the current
logical replication can work fine only if replicating to a newer major
version PostgreSQL such as from 10 to 11. Regarding using logical
replication with older major version, say sending from 11 to 10, it
will stop when a subscriber receives a truncate change because it's
not supported at PostgreSQL 10. I think there are use cases where
using logical replication with a subscriber of an older version
PostgreSQL but I'm not sure we should support it.

Of course in such case we can set the publication with publish =
'insert, update, delete' to not send truncate changes but it requres
users to recognize the feature differences between major vesions and
in the future it will get more complex. So I think it would be better
to be configured autometically by PostgreSQL.

To fix it we can make subscribers send its supporting message types to
the publisher at a startup time so that the publisher doesn't send
unsupported message types on the subscriber. Or as an another idea, we
can make subscribers ignore unsupported logical replication message
types instead of raising an error. Feedback is very welcome.

[1] https://www.postgresql.org/docs/devel/logical-replication.html

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2019-01-07 08:28:27 Re: [Sender Address Forgery]Re: error message when subscription target is a partitioned table
Previous Message Michael Paquier 2019-01-07 07:35:19 Re: [Sender Address Forgery]Re: error message when subscription target is a partitioned table