Hi Dmitry, 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() <= replay_lsn'.
Please, find attached a slightly modified version of your test (and gist [1]), which works just fine. You should replace %username% with your current username, since I did not run it as postgres user.
[1] https://gist.github.com/ololobus/a8a11f11eb67dfa1b6a95bff5e8f0096 Regards -- Alexey Kondratov Postgres Professional https://www.postgrespro.com Russian Postgres Company
logical-replication-test.sh
Description: application/shellscript