On Tue, Jun 02, 2020 at 02:23:50PM +0900, Fujii Masao wrote: > On 2020/06/02 13:24, Michael Paquier wrote: >> Still unconvinced as this restriction stands for logical decoding >> requiring a database connection but it is not necessarily true now as >> physical replication has less restrictions than a logical one. > > Could you tell me what the benefit for supporting physical replication on > logical rep connection is? If it's only for "undocumented" > backward-compatibility, IMO it's better to reject such "tricky" set up. > But if there are some use cases for that, I'm ok to support that.
Well, I don't really think that we can just break a behavior that exists since 9.4 as you could break applications relying on the existing behavior, and that's also the point of Vladimir upthread. On top of it, the issue is actually unrelated to if we want to restrict things more or not when starting replication in a WAL sender because the xlogreader creation just needs to happen when starting replication. Now we have a static "fake" one created when a WAL sender process starts, something that it would not need in most cases like answering to a BASE_BACKUP command for example. >> I can note as well that StartLogicalReplication() moves in this sense >> by setting xlogreader to be the one from logical_decoding_ctx once the >> decoding context has been created. >> >> This results in the attached. The extra test from upthread to check >> that logical decoding is not allowed in a non-database WAL sender is a >> good idea, so I have kept it. > > Yes. Also we should add the test to check if physical replication can work > fine even on logical rep connection? I found confusing the use of psql to confirm that it actually works, because we'd just return a protocol-level error in this case with psql bumping on COPY_BOTH and it is not reliable to do just an error message match. Note as well that GetConnection() discards automatically the database name for pg_basebackup and pg_receivewal as well as libpqrcv_connect() for standbys so we cannot use that. Perhaps using psql is better than nothing, but that makes me uncomfortable. -- Michael
signature.asc
Description: PGP signature