Re: Logical replication from PG v13 and below to PG v14 (devel version) is not working. - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Logical replication from PG v13 and below to PG v14 (devel version) is not working.
Date
Msg-id CAA4eK1KNbK2KDWzeGQ8wC5QkXDtLNO+oFq6YO1DJ+d5RtOB1HA@mail.gmail.com
Whole thread Raw
In response to Re: Logical replication from PG v13 and below to PG v14 (devel version) is not working.  (Dilip Kumar <dilipbalaut@gmail.com>)
Responses Re: Logical replication from PG v13 and below to PG v14 (devel version) is not working.  (Dilip Kumar <dilipbalaut@gmail.com>)
List pgsql-hackers
On Thu, Sep 24, 2020 at 5:11 PM Dilip Kumar <dilipbalaut@gmail.com> wrote:
>
> On Thu, Sep 24, 2020 at 4:45 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> >
> >
> > Have you checked what will function walrcv_server_version() will
> > return? I was thinking that if we know that subscriber is connected to
> > Publisher version < 14 then we can send the right value.
>
> But, suppose we know the publisher version is < 14 and user has set
> streaming on while  creating subscriber then still we will send the
> right version?
>

Yeah we can send the version depending on which server we are talking to?

>  I think tablesync we are forming a query so we are
> forming as per the publisher's version.  But here we are sending which
> protocol version we are expecting for the data transfer so I feel it
> should be LOGICALREP_PROTO_VERSION_NUM if we expect non-streaming
> transfer and LOGICALREP_PROTO_STREAM_VERSION_NUM if we expect the
> streaming transfer.
>

I am not sure if this is the right strategy. See
libpqrcv_startstreaming, even if the user asked for streaming unless
the server supports it we don't send the streaming option to the user.
Another thing is this check will become more complicated if we need
another feature like decode prepared to send different version or even
if it is the same version, we might need additional checks. Why do you
want to send a streaming protocol version when we know the server
doesn't support it, lets behave similar to what we do in
libpqrcv_startstreaming.

-- 
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Transactions involving multiple postgres foreign servers, take 2
Next
From: Amit Kapila
Date:
Subject: Re: Resetting spilled txn statistics in pg_stat_replication