Re: Race condition in recovery?
От | Dilip Kumar |
---|---|
Тема | Re: Race condition in recovery? |
Дата | |
Msg-id | CAFiTN-svsRLvg2HzTfEUfk0QUNEwY60oWzhvfU4BQ-RyBsG7ag@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Race condition in recovery? (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: Race condition in recovery?
|
Список | pgsql-hackers |
On Tue, Jun 8, 2021 at 12:32 AM Robert Haas <robertmhaas@gmail.com> wrote: > > 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. > Maybe we can use it ? # Wait until the node exits recovery. $standby->poll_query_until('postgres', "SELECT pg_is_in_recovery() = 'f';") or die "Timed out while waiting for promotion"; I will try to generate a version for 9.6 based on this idea and see how it goes -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com
В списке pgsql-hackers по дате отправления: