[HACKERS] Reading timeline from pg_control on replication slave

Поиск
Список
Период
Сортировка
От Andrey Borodin
Тема [HACKERS] Reading timeline from pg_control on replication slave
Дата
Msg-id BF2AD4A8-E7F5-486F-92C8-A6959040DEB6@yandex-team.ru
обсуждение исходный текст
Ответы Re: [HACKERS] Reading timeline from pg_control on replication slave  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
Hi, hackers!

I'm working on backups from replication salve in WAL-G [0]
Backups used to use result of pg_walfile_name(pg_start_backup(...)). Call to pg_start_backup() works nice, but
"pg_walfile_name()cannot be executed during recovery." 
This function has LSN as argument and reads TimeLineId from global state.
So I made a function[1] that, if on replica, reads timeline from pg_control file and formats WAL file name as is it was
producesby pg_wal_filename(lsn). 

Are there any serious dangers? Obviously, this hack is not crisp and clear. Is the risk of reading stale timeline
reallya problem? By reading TimeLineId from file I'm fighting those precautions in pg_walfile_name(..) which were
implementedfor a reason, I guess.  

Thanks for reading this. I'll be happy to hear any comments on the matter.

[0] https://github.com/wal-g/wal-g/pull/32
[1] https://github.com/wal-g/wal-g/pull/32/files#diff-455316c14fb04c9f9748a0798ad151d9R158

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Re: Is anything preventing us from allowing write toforeign tables from standby?
Следующее
От: Rajkumar Raghuwanshi
Дата:
Сообщение: Re: [HACKERS] path toward faster partition pruning