Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eW4fB-0005na-24 for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jan 2018 18:18:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eW4fA-0003Yd-IE for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jan 2018 18:18:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eW4fA-0003YT-3H for pgsql-hackers@lists.postgresql.org; Mon, 01 Jan 2018 18:18:16 +0000 Received: from mail-pl0-x233.google.com ([2607:f8b0:400e:c01::233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eW4f1-0008Ri-Vg for pgsql-hackers@postgresql.org; Mon, 01 Jan 2018 18:18:15 +0000 Received: by mail-pl0-x233.google.com with SMTP id bi12so27214827plb.6 for ; Mon, 01 Jan 2018 10:18:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5urwAQtXP6y4DNsqu+dXv2cxQpKaezqcgrfby8D0yLg=; b=UhT0Zjh3H4seIJm9JgXXSGTzjPqpGfsZBCLM9P9/Mo51tWJ30kfJT4hVsfhM3RUxBm 8aC5HTRVjcUoirLZ0rJ3s+9U7a7xwD4/5aLTn/KnUEOenUcmCC1zSdi2ZzvOdi1Mpby+ XWaaWfwm3iqK2j7wl0+oOHAcXgBXrnDY4GN0c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5urwAQtXP6y4DNsqu+dXv2cxQpKaezqcgrfby8D0yLg=; b=KQN1DcXDuj7nucZgJJYieTuOmZE60brcZt+n3N3qmJMrovQiQID7+W7yoavUH1YVdd p9IYk07yC3di0+hLhIR7fvkmx1DKkU//no7/l4f4Icnp+R3pJTHL4i8qiAy9kkc25lYk XnOlohaLLi4hEd+ojYEKH1+reYTD3bvlpKg9jeg0OdSwdVpjr++P1MbbMliZeQXJwI5T 17PuFIk/OJV3qAC9nmoX1NuvksnpZvTBtpKQmx1IMD3Y8Cv9IjT4pKPagTRDQA+rVthu imr3p39obeKAatyb/0Z2j5rNfFkSpJe3p8xKBdLpS1ae9+dqTmum8oRpVJu0KsyhZaxu NBng== X-Gm-Message-State: AKGB3mJDGuqDWKFgkGAlBBrt367Xnu+L/54i95fZ+z8IX/9IwboZ+/sa FrXz7kqfIdpE4lmCgXMWmqlmsg== X-Google-Smtp-Source: ACJfBovG0sG+NTxtyPC1RZ2SVe3v3+9rZZRDqVZA4zINXxPdANx6qhtBbgMy+c29ipYOztAt4All2Q== X-Received: by 10.84.234.198 with SMTP id i6mr42219564plt.159.1514830684986; Mon, 01 Jan 2018 10:18:04 -0800 (PST) Received: from rfd.leadboat.com (c-73-158-248-138.hsd1.ca.comcast.net. [73.158.248.138]) by smtp.gmail.com with ESMTPSA id e2sm71240301pgv.34.2018.01.01.10.18.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jan 2018 10:18:03 -0800 (PST) Date: Mon, 1 Jan 2018 10:18:01 -0800 From: Noah Misch To: Michael Paquier Cc: Alvaro Herrera , PostgreSQL mailing lists Subject: Re: Increasing timeout of poll_query_until for TAP tests Message-ID: <20180101181801.GA2925790@rfd.leadboat.com> References: <20160802222103.GA602448@alvherre.pgsql> <20180101055227.GA2952815@rfd.leadboat.com> <20180101105537.GA4733@paquier.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180101105537.GA4733@paquier.xyz> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Jan 01, 2018 at 07:55:37PM +0900, Michael Paquier wrote: > On Sun, Dec 31, 2017 at 09:52:27PM -0800, Noah Misch wrote: > > 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. > > As recovery_target_inclusive is true by default, my conclusion on the > matter, which was something that my tests on hamster, the now-dead > buildfarm animal seemed to confirm, is that just getting a timestamp at > least the value of the LSN from the same transaction was enough to fix > all the failures. And hamster was really slow. I can follow why > logically your patch makes sense, so I agree that this is sane. Have you > spotted failures from the buildfarm? No, but I checked only the last 90 days. Earlier master (e.g. git checkout 6078770^) with the following patch reproduces the failures on every run: --- a/src/test/recovery/t/003_recovery_targets.pl +++ b/src/test/recovery/t/003_recovery_targets.pl @@ -71,8 +71,8 @@ my ($lsn2, $recovery_txid) = split /\|/, $ret; $node_master->safe_psql('postgres', "INSERT INTO tab_int VALUES (generate_series(2001,3000))"); $ret = - $node_master->safe_psql('postgres', "SELECT pg_current_wal_lsn(), now();"); -my ($lsn3, $recovery_time) = split /\|/, $ret; + $node_master->safe_psql('postgres', "SELECT pg_sleep(80), pg_current_wal_lsn(), now();"); +my ($delay_for_autovacuum, $lsn3, $recovery_time) = split /\|/, $ret; # Even more data, this time with a recovery target name $node_master->safe_psql('postgres', @@ -88,6 +88,7 @@ $node_master->safe_psql('postgres', "INSERT INTO tab_int VALUES (generate_series(4001,5000))"); my $recovery_lsn = $node_master->safe_psql('postgres', "SELECT pg_current_wal_lsn()"); +$node_master->safe_psql('postgres', 'VACUUM'); # write some WAL my $lsn5 = $node_master->safe_psql('postgres', "SELECT pg_current_wal_lsn();");