Re: PgFDW connection invalidation by ALTER SERVER/ALTER USER MAPPING

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: ashutosh(dot)bapat(at)enterprisedb(dot)com, pgsql-hackers(at)postgresql(dot)org, Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp, fcs1(at)poczta(dot)onet(dot)pl
Subject: Re: PgFDW connection invalidation by ALTER SERVER/ALTER USER MAPPING
Date: 2017-07-20 06:25:33
Message-ID: 20170720.152533.252230418.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Finally, I added new TAP test library PsqlSession.

At Tue, 18 Jul 2017 18:12:13 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote in <20170718(dot)181213(dot)206979369(dot)horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
> > * How about some regression test cases? You couldn't really exercise
> > cross-session invalidation easily, but I don't think you need to.
>
> Ha Ha. You got me. I will add some test cases for this in the
> next version. Thanks.

Here it is. First I tried this using ordinary regression
framework but the effect of this patch is shown only in log and
it contains variable parts so I gave up it before trying more
complex way.

Next I tried existing TAP test but this test needs continuous
session to achieve alternating operation on two sessions but
PostgresNode::psql doesn't offer such a functionality.

Finally, I added a new TAP test library PsqlSession. It offers
interactive psql sessions. Then added a simple test to
postgres_fdw using it.

The first patch is the PsqlSession.pm and the second is the new
test for postgres_fdw.

- The current PsqlSession is quite fragile but seems working
enough for this usage at the present.

- I'm afraid this might not work on Windows according to the
manpage of IPC::Run, but I haven't confirmed yet.

http://search.cpan.org/~toddr/IPC-Run-0.96/lib/IPC/Run.pm#Win32_LIMITATIONS

Any comment or suggestions are welcome.

regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
0001-Add-new-TAP-test-library-PsqlSession.pm.patch text/x-patch 7.1 KB
0002-Add-test-for-reconnection-feature.patch text/x-patch 3.4 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message buhhunyx 2017-07-20 07:40:40 Re: BUG #14750: Seq Scan instead of Index Scan works without limitation
Previous Message Chris Pacejo 2017-07-19 17:39:39 Re: BUG #14691: Isolation failure in deferrable transaction concurrent with schema change

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2017-07-20 06:26:53 Re: [PATCH] pageinspect function to decode infomasks
Previous Message Ashutosh Bapat 2017-07-20 06:17:57 Re: Partition-wise join for join between (declaratively) partitioned tables