Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHGvM-0006ro-1r for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Mar 2021 02:07:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lHGvK-00079d-RN for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Mar 2021 02:07:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHGvK-00079W-Kd for pgsql-hackers@lists.postgresql.org; Wed, 03 Mar 2021 02:07:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHGvI-00073U-HB for pgsql-hackers@postgresql.org; Wed, 03 Mar 2021 02:07:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 12327HDS1127615; Tue, 2 Mar 2021 21:07:17 -0500 From: Tom Lane To: Greg Nancarrow cc: vignesh C , Alvaro Herrera , Anastasia Lubennikova , Peter Smith , "Smith, Peter" , David Steele , "Tsunakawa, Takayuki" , Haribabu Kommi , Robert Haas , Laurenz Albe , Dave Cramer , Jing Wang , PostgreSQL-development , Elvis Pranskevichus Subject: Re: Libpq support to connect to standby server as priority In-reply-to: References: <20201124225917.GA21884@alvherre.pgsql> <325979.1606259987@sss.pgh.pa.us> <388250.1606266434@sss.pgh.pa.us> <493358.1606322607@sss.pgh.pa.us> <3425296.1609882492@sss.pgh.pa.us> Comments: In-reply-to Greg Nancarrow message dated "Tue, 16 Feb 2021 16:48:37 +1100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1127613.1614737237.1@sss.pgh.pa.us> Date: Tue, 02 Mar 2021 21:07:17 -0500 Message-ID: <1127614.1614737237@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Greg Nancarrow writes: > I've marked this as "Ready for Committer". I've pushed this after whacking it around a fair amount. A lot of that was cosmetic, but one thing that wasn't is that I got rid of the proposed "which_primary_host" variable. I thought the logic around that was way too messy and probably buggy. Even if it worked exactly as intended, I'm dubious that the design intention was good. I think it makes more sense just to go through the whole server list again without the restriction to standby servers. In particular, that will give saner results if the servers' status isn't holding still. regards, tom lane