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 1pQA8k-00011d-P7 for pgsql-general@arkaria.postgresql.org; Thu, 09 Feb 2023 16:51:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pQA8j-0000kQ-KF for pgsql-general@arkaria.postgresql.org; Thu, 09 Feb 2023 16:51:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pQA8j-0000kH-8r for pgsql-general@lists.postgresql.org; Thu, 09 Feb 2023 16:51:17 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pQA8h-0004JA-0b for pgsql-general@lists.postgresql.org; Thu, 09 Feb 2023 16:51:16 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 565815C00D0; Thu, 9 Feb 2023 11:51:14 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 09 Feb 2023 11:51:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1675961474; x= 1676047874; bh=4SZ9sRYi1B3KjaRDbTUPPP4n2WGfz+7gN8YAoHYQDnI=; b=k P3I2OucuwjOTfRw5o36ugLBKao+aFEzzKIfNYGYznYJGkK+jjoZ3Hkf2NUA8GB1T ZTMbOt/If9PpklNonOGUdpakV3YBeem7W2sijZoRXkgP5talfv/feDwha93oRcrO PtPEqESYrTemFh1RE9ZagqvNnWEMn+jNWKubOlb0rULjq5UD2XKsjSAaxgJ9wr/A 9wDRlicoa+G7tFoOySCXlEwBiSqITA8NQEgEaD0rABQk+9gXT9XkzI5Xo6APR5gJ RUm+ohNk7o5MfDEOISUKUp3oaCvP3UqTrQ+PWGNWV91RaDRTYlNzm1dnblpzEn0m l0TqpYrHnNNtCLrZ4i0Ew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1675961474; x= 1676047874; bh=4SZ9sRYi1B3KjaRDbTUPPP4n2WGfz+7gN8YAoHYQDnI=; b=S 0sgr/YtiitalW9VmWom8M7vDepKi/ZJlnn6NmcbWw6gsohTPZB5goojMNH6esvhf jS1LasBl0WZzRX3zONxZJq/TrQ2O43P5PXLmk+U211xCOoiimOM3s88J1YL03QJd 59aYtRiyCFDfvi0AEoTFI9bHSvyy0z0tSNCVTho2vFEF80+0m5e6xxN6Sp1dbUWh OqeP11i/P8XrYiUphpPGbP9T0v/GzXMY/JApGXP6fw2nQi4g05C0d6+i2B+jwcXi rKK6bZQzGe9D5W2FxtVKUoF4Y5S9cFJdqTBR67BBKYbgQ/PyZp+xFxraYg/8Tk8p 7/g+VVxRGyNXVumXLdX0g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudehfedgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepjeegtdfhuefhtefgffdvheduleetgeejudevffek teegjeeiheeuudellefgffffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 9 Feb 2023 11:51:13 -0500 (EST) Message-ID: Date: Thu, 9 Feb 2023 08:51:13 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: Using PostgreSQL for service discovery and health-check Content-Language: en-US To: Dominique Devienne Cc: pgsql-general@lists.postgresql.org References: From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/9/23 08:16, Dominique Devienne wrote: > On Thu, Feb 9, 2023 at 5:05 PM Adrian Klaver > wrote: > > Is there more then one server providing the same service? > > > Yes. That was my PS: basically. The client can connect to any one, randomly. > We need at least one of course. But there could me more than 1, yes. > Would it no be easier to not have random ports and just attempt > connections to the servers either: > 1) In the client with reattempt to different port on failure. > 2) From Postgres server and update table to have current up servers. > > > I'm sorry, but I'm not following. Can you perhaps rephrase? > > Regarding ports, once you have registration of services, just seems > easier to me to NOT have a fixed port, > and let the host assign any port to the HTTP server. Those servers are > not user-facing directly, from the client > side, it calls an API and lookup of the service and connection to the > HTTP server is transparent is an implementation > detail, so the port used doesn't matter. In-DB registration of (HTTP) > servers makes the while URL an implementation detail. The flip side of that is that with known ports it would it easier to have a process on the Postgres machine or in the database that checks the ports on regular basis. And as part of that process mark any non responding ports as inactive. That would solve the zombie problem. -- Adrian Klaver adrian.klaver@aklaver.com