Re: Increasing timeout of poll_query_until for TAP tests

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Increasing timeout of poll_query_until for TAP tests
Date: 2016-08-02 22:21:03
Message-ID: 20160802222103.GA602448@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier wrote:

> Here using pg_xlog_replay_resume() is not the correct solution because
> this would cause the node to finish recovery before we want it to, and
> so is recovery_target_action = 'promote'. If we look at the test, it
> is doing the following when getting the TXID that is used as recovery
> target:
> $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?

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
recovery-test-fixes-2.patch text/x-diff 1.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-08-02 22:40:37 Re: Double invocation of InitPostmasterChild in bgworker with -DEXEC_BACKEND
Previous Message David G. Johnston 2016-08-02 21:42:07 Re: Fwd: [BUGS] BUG #14247: COMMENT is restored on wrong database