Re: Increasing timeout of poll_query_until for TAP tests

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Re: Increasing timeout of poll_query_until for TAP tests
Дата
Msg-id 20180101055227.GA2952815@rfd.leadboat.com
обсуждение исходный текст
Ответ на Re: Increasing timeout of poll_query_until for TAP tests  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Increasing timeout of poll_query_until for TAP tests
Список pgsql-hackers
On Tue, Aug 02, 2016 at 06:21:03PM -0400, Alvaro Herrera wrote:
> Michael Paquier wrote:
> > $node_master->safe_psql('postgres',
> >         "INSERT INTO tab_int VALUES (generate_series(1001,2000))");
> > my $recovery_txid =
> >   $node_master->safe_psql('postgres', "SELECT txid_current()");
> > my $lsn2 =
> >   $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location();");
> > What I think we had better do is reverse the calls
> > pg_current_xlog_location() and txid_current() so as we are sure that
> > the LSN we track for replay is lower than the real target LSN. The
> > same problem exists when defining the timestamp target.
> > 
> > The patch attached does that,
> 
> Why not capture both items in a single select, such as in the attached
> patch?

> -my $recovery_time = $node_master->safe_psql('postgres', "SELECT now()");
> -my $lsn3 =
> -  $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location();");
> +$ret =
> +  $node_master->safe_psql('postgres', "SELECT pg_current_xlog_location(), now();");
> +my ($lsn3, $recovery_time) = split /\|/, $ret;

Since now() is transaction_timestamp(), $recovery_time precedes or equals
$lsn3, and this didn't close the race.  Using clock_timestamp() here would
work, as does using separate transactions like recovery-test-fixes.patch did.
I'll shortly push a fix for this and a similar ordering problem in the
standby_5 test, which first appeared subsequent to this thread.


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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Contributing with code
Следующее
От: Beena Emerson
Дата:
Сообщение: Re: [HACKERS] Runtime Partition Pruning