Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bf0gR-0005Os-H8 for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Aug 2016 08:15:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bf0gR-0004LE-3q for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Aug 2016 08:15:43 +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 1bf0f1-0001Zb-W3 for pgsql-hackers@postgresql.org; Wed, 31 Aug 2016 08:14:16 +0000 Received: from mx.wagner.pp.ru ([78.46.190.96]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bf0ey-00087i-PP for pgsql-hackers@postgresql.org; Wed, 31 Aug 2016 08:14:14 +0000 Received: from mail.wagner.pp.ru (unknown [192.168.217.131]) by mx.wagner.pp.ru (Postfix) with ESMTP id 07BCBE021C for ; Wed, 31 Aug 2016 11:13:37 +0300 (MSK) Received: from fafnir.local.vm (newmail.postgrespro.ru [93.174.131.138]) by mail.wagner.pp.ru (Postfix) with ESMTPSA id 1C3CF23846 for ; Wed, 31 Aug 2016 11:13:35 +0300 (MSK) Date: Wed, 31 Aug 2016 11:13:34 +0300 From: Victor Wagner To: pgsql-hackers@postgresql.org Subject: Re: Patch: Implement failover on libpq connect level. Message-ID: <20160831111334.461689cf@fafnir.local.vm> In-Reply-To: References: <20160201220540.GA99599@alvherre.pgsql> <56E0AD90.5090409@pgmasters.net> <56E9E978.5090103@pgmasters.net> 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.4 (---) 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 Fri, 26 Aug 2016 10:10:33 +0530 Mithun Cy wrote: > On Thu, Mar 17, 2016 at 4:47 AM, David Steele > wrote: > >Since there has been no response from the author I have marked this > >patch > "returned with feedback". Please feel free >to resubmit for 9.7! > I have started to work on this patch, and tried to fix some of the > issues discussed above. The most recent patch 06 has fixed many > issues which was raised previously which include indefinite looping, > crashes. And, some of the issues which remain pending are. > > 1. Connection status functions PQport, PQhost do not give > corresponding values of established connection. -- Have attached the > patch for same. > > 2. Default value of readonly parameter is 0, which means should > connect to master only. So absence of parameter in connection string > in simple cases like "./psql -p PORT database" fails to connect to > hot standby server. I think since if readonly=1 means connect to > any. and readonly=0 means connect to master only, we should change > the default value to 1, to handle the cases when parameter is not > specified. > > JFYI Interestingly PostgreSql JDBC driver have following options > targetServerType=any|master|slave|preferSlave for same purpose. > > Also did a little bit of patch clean-up. > > Also found some minor issues related to build which I am working on. > 1. make check-world @src/interfaces/ecpg/test/connect fails with > following error: > gcc -Wall -Wmissing-prototypes -Wpointer-arith > -Wdeclaration-after-statement -Wendif-labels > -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing > -fwrapv -fexcess-precision=standard -g -O0 -pthread -D_REENTRANT > -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS test1.o -L../../ecpglib > -L../../pgtypeslib -L../../../../../src/interfaces/libpq > -L../../../../../src/port -L../../../../../src/common -Wl,--as-needed > -Wl,-rpath,'/home/mithun/edbsrc/patch6bin/lib',--enable-new-dtags > -lecpg -lpgtypes -lpq -lpgcommon -lpgport -lz -lrt -lcrypt -ldl -lm > -o test1 ../../../../../src/interfaces/libpq/libpq.so: undefined > reference to `pg_usleep' > collect2: error: ld returned 1 exit status > make[3]: *** [test1] Error 1 > make[3]: Leaving directory `/home/mithun/mynewpost/p1/ > src/interfaces/ecpg/test/connect' > > patch has used pg_usleep() which is in L../../../../../src/port I > think dependency is not captured rightly. > > Thanks and Regards > Mithun C Y > EnterpriseDB: http://www.enterprisedb.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers