Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zpauc-0002JS-BC for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Oct 2015 11:53:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zpaua-0006my-IJ for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Oct 2015 11:53:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Zpaua-0006ms-1m for pgsql-hackers@postgresql.org; Fri, 23 Oct 2015 11:53:32 +0000 Received: from wagner.pp.ru ([178.63.209.18] helo=mx.wagner.pp.ru) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZpauR-00027f-G3 for pgsql-hackers@postgresql.org; Fri, 23 Oct 2015 11:53:30 +0000 Received: from mail.wagner.pp.ru (unknown [192.168.217.132]) by mx.wagner.pp.ru (Postfix) with ESMTP id 99CE4486147 for ; Fri, 23 Oct 2015 14:52:45 +0300 (MSK) Received: from fafnir (newmail.postgrespro.ru [93.174.131.138]) by mail.wagner.pp.ru (Postfix) with ESMTPSA id C5FFD20024 for ; Fri, 23 Oct 2015 14:52:34 +0300 (MSK) Date: Fri, 23 Oct 2015 14:52:33 +0300 From: Victor Wagner To: pgsql-hackers@postgresql.org Subject: Re: Patch (2): Implement failover on libpq connect level. Message-ID: <20151023145233.2a110244@fafnir> In-Reply-To: References: <20150818041850.GA5092@wagner.pp.ru> <20151014104151.GA6744@wagner.pp.ru> <20151021090722.GA7825@wagner.pp.ru> X-Mailer: Claws Mail 3.11.1 (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: -1.9 (-) 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 Thu, 22 Oct 2015 14:33:11 +0100 Thom Brown wrote: > On 21 October 2015 at 10:07, Victor Wagner wrote: > > On 2015.10.14 at 13:41:51 +0300, Victor Wagner wrote: > > > >> > >> Attached patch which implements client library failover and > >> loadbalancing as was described in the proposal > >> <20150818041850.GA5092@wagner.pp.ru>. > >> > > > > I'm sending imporoved verison of patch. As Olexander Shulgin noted, > > previous version of patch lacks support for service files. > > > > Now support for service files is implemented and multiple host > > statements in the service file are allowed. > > This is causing breakage: > > $ pg_basebackup -v -x -D standby1 -h localhost -p 5532 -U rep_user > row number 0 is out of range 0..-1 It seems that pg_basebackup should always specify readonly attribute for the connection. Your data directory is named standby1, so I suspect that you are trying to make backup from read-only standby instance of the base. Can you check if problem persists in your setup with command pg_basebackup -v -x -D standby1 \ -d "host=localhost port=5532 user=rep_user readonly=1" > Segmentation fault Of course, this shouldn't happen even if libpq is severely misused. And it is almost evident what should be done to fix it. But making sure that my patch doesn't interfere with operation of pg_basebackup is a bit more complicated. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers