pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Victor Wagner <vitus@wagner.pp.ru>
To: pgsql-hackers@postgresql.org
Subject: Re: Patch: Implement failover on libpq connect level.
Date: Tue, 6 Sep 2016 08:03:49 +0300
Message-ID: <20160906080349.0a7dcf69@wagner.wagner.home> (raw)
In-Reply-To: <CAD__OujS2tU9nkTAeVnfJ-vMe8+JT3Po+puSopu8WF_Cyx4sOA@mail.gmail.com>
References: <56E0AD90.5090409@pgmasters.net>
	<CANP8+jKPORaK2Xhuwc6KJ6qwfL8KiVZjxDw16sS0XoDe0Kh7qw@mail.gmail.com>
	<56E9E978.5090103@pgmasters.net>
	<CAD__OugniD9nz6weXCvnEELKX2iTK3xCmVWttVjLH0k5rn_NOA@mail.gmail.com>
	<CAD__Ouh53ttKfZ-439R9OGDOx=1xbBHS34SKOgTLqu73=gcp7Q@mail.gmail.com>
	<20160831111330.53a018ed@fafnir.local.vm>
	<CAD__OuimXSFUNCXXfcXXGEceuH8ik+Hr9qSYU0BidZw4gSxdig@mail.gmail.com>
	<CAD__Oui-3m6W83HyQNQLczrGRDQr4R67jv76DGwf1tT764zQ5A@mail.gmail.com>
	<CAD__OuhfOL-TQz-BBrFMj_tu8DqTc+ccxbwLkj+tUHAzvH14Pw@mail.gmail.com>
	<20160905072215.4efd7b8a@wagner.wagner.home>
	<20160905110311.GA11351@e733>
	<CAD__OujS2tU9nkTAeVnfJ-vMe8+JT3Po+puSopu8WF_Cyx4sOA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On Tue, 6 Sep 2016 07:58:28 +0530
Mithun Cy <mithun.cy@enterprisedb.com> wrote:

> 
> Now if only one host is in connection string and it ask for read_write
> connection(connect to master) I mean read_only is set 0 explicitly.
> With above logic we will allow it to connect to standby?. I still
> think psql connection to standby should be handled by changing the
> default value of readonly to 1 (which means connect to any). 

It would definitely be more logical, but I haven't found easy way to do
it. May be I should return to this place and rethink. I don't like and
idea to explicitely ignore connection string parameter due to some
condition. 

Really, I think, test for replication connection can be either
removed from this part of code now.  


> Thinking
> further probably replacing readonly parameter with
> targetServerType=any|master (with default being any) should clear
> some confusions and bring consistency since same is used in JDBC
> multi host connection string.

It seems that in this context change readonly=0|1 to
targetServerType=any|master  makes sense.


 
> 2)
> @@ -1460,33 +1538,80 @@ connectDBStart(PGconn *conn)
>    portstr,
>    (int) (UNIXSOCK_PATH_BUFLEN - 1));
>   conn->options_valid = false;
> + free(nodes->port);
> 
> nodes->port was not allocated at this point.
> 

I'll recheck it.

-- 
                                   Victor Wagner <vitus@wagner.pp.ru>


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (165+ messages)  latest in thread

Message-ID: <20160906080349.0a7dcf69@wagner.wagner.home>
Permalink:  ../20160906080349.0a7dcf69@wagner.wagner.home/
Also on:    postgresql.org/message-id/20160906080349.0a7dcf69@wagner.wagner.home

 · 

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-jdbc@postgresql.org
  Cc: vitus@wagner.pp.ru, pgsql-hackers@postgresql.org
  Subject: Re: Patch: Implement failover on libpq connect level.
  In-Reply-To: <20160906080349.0a7dcf69@wagner.wagner.home>
  References: <56E0AD90.5090409@pgmasters.net> <CANP8+jKPORaK2Xhuwc6KJ6qwfL8KiVZjxDw16sS0XoDe0Kh7qw@mail.gmail.com> <56E9E978.5090103@pgmasters.net> <CAD__OugniD9nz6weXCvnEELKX2iTK3xCmVWttVjLH0k5rn_NOA@mail.gmail.com> <CAD__Ouh53ttKfZ-439R9OGDOx=1xbBHS34SKOgTLqu73=gcp7Q@mail.gmail.com> <20160831111330.53a018ed@fafnir.local.vm> <CAD__OuimXSFUNCXXfcXXGEceuH8ik+Hr9qSYU0BidZw4gSxdig@mail.gmail.com> <CAD__Oui-3m6W83HyQNQLczrGRDQr4R67jv76DGwf1tT764zQ5A@mail.gmail.com> <CAD__OuhfOL-TQz-BBrFMj_tu8DqTc+ccxbwLkj+tUHAzvH14Pw@mail.gmail.com> <20160905072215.4efd7b8a@wagner.wagner.home> <20160905110311.GA11351@e733> <CAD__OujS2tU9nkTAeVnfJ-vMe8+JT3Po+puSopu8WF_Cyx4sOA@mail.gmail.com> <20160906080349.0a7dcf69@wagner.wagner.home>

* 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