pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: postgres_fdw: Fix tests for  CLOBBER_CACHE_ALWAYS.
Date: Sat, 30 Jan 2021 01:13:22 +0000
Message-ID: <E1l5epG-0001zJ-2E@gemulon.postgresql.org> (raw)

postgres_fdw: Fix tests for  CLOBBER_CACHE_ALWAYS.

The regression tests added in commits 708d165ddb and 411ae64997 caused
buildfarm failures when  CLOBBER_CACHE_ALWAYS was enabled.
This commit stabilizes those tests.

The foreign server connections established by postgres_fdw behaves
differently depending on whether CLOBBER_CACHE_ALWAYS is enabled or not.
If it's not enabled, those connections are cached. On the other hand,
if it's enabled, when the connections are established outside transaction
block, they are not cached (i.e., they are immediately closed at the end of
query that established them). So the subsequent postgres_fdw_get_connections()
cannot list those connections and postgres_fdw_disconnect() cannot close them
(because they are already closed).

When the connections are established inside transaction block, they are
cached whether CLOBBER_CACHE_ALWAYS was enabled or not. But if it's enabled,
they are immediately marked as invalid, otherwise not. This causes the
subsequent postgres_fdw_get_connections() to return different result in
"valid" column depending on whether CLOBBER_CACHE_ALWAYS was enabled or not.

This commit prevents the above differences of behavior from
affecting the regression tests.

Per buildfarm failure on trilobite.

Original patch by Bharath Rupireddy. I (Fujii Masao) extracted
the regression test fix from that and revised it a bit.

Reported-by: Tom Lane
Author: Bharath Rupireddy
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/2688508.1611865371@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f77717b2985aa529a185e6988de26b885ca10ddb

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 223 ++++++++++---------------
contrib/postgres_fdw/sql/postgres_fdw.sql      |  97 ++++-------
2 files changed, 121 insertions(+), 199 deletions(-)



Message-ID: <E1l5epG-0001zJ-2E@gemulon.postgresql.org>
Permalink:  ../E1l5epG-0001zJ-2E@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1l5epG-0001zJ-2E@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org
  Subject: Re: pgsql: postgres_fdw: Fix tests for  CLOBBER_CACHE_ALWAYS.
  In-Reply-To: <E1l5epG-0001zJ-2E@gemulon.postgresql.org>
  References: <E1l5epG-0001zJ-2E@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox