Re: Patch: Implement failover on libpq connect level.

From: Victor Wagner <vitus(at)wagner(dot)pp(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: Re: Patch: Implement failover on libpq connect level.
Date: 2016-01-24 09:18:32
Message-ID: 20160124121832.04fa9dcd@wagner.wagner.home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

On Fri, 22 Jan 2016 16:36:15 -0300
Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:

> You're editing the expected file for the libpq-regress thingy, but you
> haven't added any new lines to test the new capability. I think it'd
> be good to add some there. (I already said this earlier in the
> thread; is there any reason you ignored it the first time?)

I seriously doubt that this program can be used to test new
capabilities.

All it does, it calls PQconninfoParse and than examines some fields of
PGconn structure.

The only reason I've to modify expected output is that I changed usage
of one of these field, and keep there comma-separated list of host:port
pairs instead of just hostname.

Thus contents this field after parsing of some existing URIs is
changed, while semantic of URIs is same.

If I add some new uris, than only thing I can test is that comma is
properly copied from the URI to this field. And may be that some syntax
errors are properly detected.


> If the test program requires improvement to handle the new stuff,
> let's do that.

The only improvement I can think of, is to examine list of the addrinfo
structures into which host list is eventually parsed. But it is quite
problematic, because it depends on many factors which are outside of
our control.

It stores addresses resolved via OS's name resolver.

For example, if we specify 'localhost' there it can be parsed into one
or to records, depending on presence of IPv6 support.

If we use some other hostname here, we'll rely on internet connectivity
and DNS system. And we cannot ensure that any name to IP mapping will
persist for a long enough time.

So, I think that new functionality need other approach for testing.
There should be test of real connection to real temporary cluster.
Probably, based on Perl TAP framework which is actively used in the
Postgres recently.
>

--
Victor Wagner <vitus(at)wagner(dot)pp(dot)ru>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2016-01-24 10:04:08 Re: Why format() adds double quote?
Previous Message Jinhua Luo 2016-01-24 06:03:20 Re: insert/update performance

Browse pgsql-jdbc by date

  From Date Subject
Next Message Pavel Raiskup 2016-01-24 09:37:32 Re: Wrong link not pointing to the release tarball
Previous Message Thom Brown 2016-01-23 04:23:30 Re: Patch: Implement failover on libpq connect level.