Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bh8YN-0001kR-6O for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Sep 2016 05:04:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bh8YM-0008Ss-HP for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Sep 2016 05:04:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bh8YM-0008Sm-21 for pgsql-hackers@postgresql.org; Tue, 06 Sep 2016 05:04:10 +0000 Received: from mx.wagner.pp.ru ([78.46.190.96]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bh8YJ-0000bb-El for pgsql-hackers@postgresql.org; Tue, 06 Sep 2016 05:04:08 +0000 Received: from mail.wagner.pp.ru (unknown [192.168.217.131]) by mx.wagner.pp.ru (Postfix) with ESMTP id BB2DCE0047 for ; Tue, 6 Sep 2016 08:03:50 +0300 (MSK) Received: from wagner.wagner.home (wagner.wagner.home [192.168.217.1]) by mail.wagner.pp.ru (Postfix) with ESMTPSA id 2544621294 for ; Tue, 6 Sep 2016 08:03:50 +0300 (MSK) Date: Tue, 6 Sep 2016 08:03:49 +0300 From: Victor Wagner To: pgsql-hackers@postgresql.org Subject: Re: Patch: Implement failover on libpq connect level. Message-ID: <20160906080349.0a7dcf69@wagner.wagner.home> In-Reply-To: References: <56E0AD90.5090409@pgmasters.net> <56E9E978.5090103@pgmasters.net> <20160831111330.53a018ed@fafnir.local.vm> <20160905072215.4efd7b8a@wagner.wagner.home> <20160905110311.GA11351@e733> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -3.6 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Tue, 6 Sep 2016 07:58:28 +0530 Mithun Cy 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers