On Mon, Feb 11, 2019 at 05:39:49PM +0300, Dmitry Vasiliev wrote:
> Do I understand correctly that logical replication and recovery from
> pg_basebackup are incompatible things?
When using physical streaming replication, it is mandatory to have
nodes with a system ID matching, meaning that all nodes have been
created from the same source instance. With logical replication,
nodes are separate entities from this point of view, hence you may be
able to make a logical copy from a base backup, however this is not
really necessary as changes are exchanged in a logical shape.
On 11.02.2019 17:39, Dmitry Vasiliev wrote:
> What is the scope of logical replication if I cannot make recovery
> from pg_basebackup?
No, you can, but there are some things to keep in mind:
1) I could be wrong, but usage of pgbench in such a test seems to be a
bad idea, since it drops and creates tables from the scratch, when -i is
passed. However, if I recall it correctly, pub/sub slots use OIDs of
relations, so I expect that you should get only initial sync data on
replica and last pgbench results on master.
2) Next, 'srsubstate' check works only for initial sync. After that you
should poll master's replication slot lsn for 'pg_current_wal_lsn() <=
Please, find attached a slightly modified version of your test (and gist
), which works just fine. You should replace %username% with your
current username, since I did not run it as postgres user.