Re: Race condition in recovery?

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Race condition in recovery?
Дата
Msg-id CA+TgmoZwJ72s6zwv-wAQrLfRbj5Fvn+H+046mqV=VozKcvWS+w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Race condition in recovery?  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Race condition in recovery?  (Dilip Kumar <dilipbalaut@gmail.com>)
Список pgsql-hackers
Hi,

I tried back-porting my version of this patch to 9.6 to see what would
happen there. One problem is that some of the functions have different
names before v10. So 9.6 needs this:

-    "SELECT pg_walfile_name(pg_current_wal_lsn());");
+    "SELECT pg_xlogfile_name(pg_current_xlog_location());");

But there's also another problem, which is that this doesn't work before v12:

$node_standby->psql('postgres', 'SELECT pg_promote()');

So I tried changing it to this:

$node_standby->promote;

But then the test fails, because pg_promote() has logic built into it
to wait until the promotion actually happens, but ->promote doesn't,
so SELECT pg_walfile_name(pg_current_wal_lsn()) errors out because the
system is still in recovery. I'm not sure what to do about that. I
quickly tried adding -w to 'sub promote' in PostgresNode.pm, but that
didn't fix it, so I guess we'll have to find some other way to wait
until the promotion is complete.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Make unlogged table resets detectable
Следующее
От: Tom Lane
Дата:
Сообщение: Re: SQL-standard function body