Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpiZu-0007pQ-CJ for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Oct 2015 20:04:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZpiZt-0004fL-PP for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Oct 2015 20:04:41 +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 1ZpiZr-0004fC-Va for pgsql-hackers@postgresql.org; Fri, 23 Oct 2015 20:04:40 +0000 Received: from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZpiZj-0003Qn-Hu for pgsql-hackers@postgresql.org; Fri, 23 Oct 2015 20:04:38 +0000 Received: by qkca6 with SMTP id a6so87413884qkc.3 for ; Fri, 23 Oct 2015 13:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb_com.20150623.gappssmtp.com; s=20150623; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=b3tj/BnbDStoZlIUCFE9TG8jD6a2zuTCUNl4RN3na+A=; b=fiTKaZXyw5WNpLJF8icUTnm7VemWxiX/K4YjS7PFakt2Gupq8sEirpV1Yeusb2ypHQ KGF777T0ioH/RuZUhVgnXk10Wxgcokt3Qt/6l1qEfgwxuxnotCiR0eC0bloUM3/tCvZN XFisGFwrzy1Azib5u+mGPwZjwjdSbkBaMdsqeb6qCjnO1mVyD7KiV0+x3ugb1/S7JDha pZLQSUB0PK2+S3w/SKQY2b1wv/3xTdDs6cUXqv+i+OEPCQTq2innMxXroAE9zBWi/zp/ gLesjYr+FdZZaA8OPGyx0y5mW5XRXMERT+xAI0LTx4KlrIMCS1zNzeZyfWeOLpGrg6rV PsNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=b3tj/BnbDStoZlIUCFE9TG8jD6a2zuTCUNl4RN3na+A=; b=ceT8ZRZFnKhnRTBv5Yqioi7bm4R/jFkZp0fOJ4W31g44dEw170nzglA4T1WprwKeID Nizjd8IvVLiiKje2q/jISaxbhXTKMKAFj3B3PkO5sKmmmGmjEk2DQL/UAVSpECO3dczR ArXBcAo6VznIdsNK7cnMgKc7wlD8cSGuMZ4MLCEkVxRB7a6Hfq+8ab0BtdmWyCLFbShn 5D70w+asYfi1AI2v/eKBirqIMFElr2iHhKJ4iOOfptrDUhYFvkl07l7IGSTCULQZRaRX o4droQaN/mZ7hALbXptA0Fbpnb7PfCdlFOualzgkwiU1Acd5OvUZFJJtva9HfSFLTxEA wM2w== X-Gm-Message-State: ALoCoQllnl1MJYfEpayd4q0LGyddTjnuhWj7hl56jKuc3FnlMe5DuFtUiLtALkaazxmXfoCfLpDJ89Qt5taqYdM7LzIVCuVhm2qD+SOJ2A50vTvbPciMtbpNNxDgQNEseDoijk4FHRWzBK0NLJ8I+PiQv86RwNberu5Qtj6HEdCJZ2P8KOlCQdRXduW7WnScpeVYvbWCrMF3 X-Received: by 10.55.43.129 with SMTP id r1mr27735171qkr.104.1445630669788; Fri, 23 Oct 2015 13:04:29 -0700 (PDT) Received: from MegaMac.local (va-76-4-65-131.sta.embarqhsd.net. [76.4.65.131]) by smtp.gmail.com with ESMTPSA id h60sm8089639qgh.7.2015.10.23.13.04.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Oct 2015 13:04:28 -0700 (PDT) Message-ID: <562A9259.4060408@enterprisedb.com> Date: Fri, 23 Oct 2015 16:02:33 -0400 From: Korry Douglas User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: pgsql-hackers@postgresql.org Subject: Re: Patch (2): Implement failover on libpq connect level. References: <20150818041850.GA5092@wagner.pp.ru> <20151014104151.GA6744@wagner.pp.ru> <20151021090722.GA7825@wagner.pp.ru> In-Reply-To: <20151021090722.GA7825@wagner.pp.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.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 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. A couple of minor nits: When you call pg_is_in_recovery(), you should schema-qualify the function name, just in case some other version of that function exists in the search_path. Also, pg_is_in_recovery() returns a boolean value - PQgetvalue() will not return "true" or "false", it will return "t" or "f". And, you have a bit of garbage in the patch (the patch inserts UNIXSOCK_PATH(portstr, portnum, conn->pgunixsocket); in the header comment at the top of fe-connect.c). -- Korry -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers