Re: Logical replication and restore from pg_basebackup

Поиск
Список
Период
Сортировка
От Alexey Kondratov
Тема Re: Logical replication and restore from pg_basebackup
Дата
Msg-id 67d1c1d6-420f-5c4d-dfc3-50c402e487d7@postgrespro.ru
обсуждение исходный текст
Ответ на Logical replication and restore from pg_basebackup  (Dmitry Vasiliev <dmitry.vasiliev@coins.ph>)
Список pgsql-hackers
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


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Antonin Houska
Дата:
Сообщение: Re: Problems with plan estimates in postgres_fdw
Следующее
От: Oleksii Kliukin
Дата:
Сообщение: Re: Connection slots reserved for replication