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 1lYxOs-0002CD-4J for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Apr 2021 20:55:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lYxOo-0003Gh-Fr for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Apr 2021 20:55:10 +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 1lYxOo-0003Fg-8O for pgsql-hackers@lists.postgresql.org; Tue, 20 Apr 2021 20:55:10 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lYxOi-0001VK-M0 for pgsql-hackers@postgresql.org; Tue, 20 Apr 2021 20:55:08 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 85EFE3F50; Tue, 20 Apr 2021 16:55:02 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 20 Apr 2021 16:55:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=iQs35Dgyu8hzaPZIZ6ninyfi2KS/5b5tcAhJ6FL+fVU=; b=MzHXlOFM SltG/7JzEIEAUvLy9KiBaBHWNkDhvr6A1SOBNWMSzu91CkLU1qLd1hUtQf5avTKq xto5KE6E1YO8k/fUWM1WEfCdZUwDeImavVnxYynaCrXuzcKUf4eo2LxJ/u3YLKC2 ao1W7+uCKBk7idB2WY0/kqPxPtHeUG7D8+4AB4C5dTXJijvdiDXSj6HilnVxr3x6 0kh3L9I47TdCNGzOiQcP2bwIdCZwRYzW6hcpV6CHRTFR8uqQmAbInt7GvLec651N jLKFfnGms69fpZsg088ynqR/MvQ8iPBNIoziiZHbqXUBVoZiqqEcm/JKsfBL/Qz8 HgaXkhsFbqw7lA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtiedgudehkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjggfsehtkeertddtredunecuhfhrohhmpeetlhhv rghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpeeufffhjeeiueeuffegvddukeegledtveeivdeiueef ieeivefgteehueefteehvdenucfkphepudeltddrleehrdduledrleehnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegr lhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id 6AC6724005A; Tue, 20 Apr 2021 16:55:00 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id AC2212A099A; Tue, 20 Apr 2021 16:54:57 -0400 (-04) Date: Tue, 20 Apr 2021 16:54:57 -0400 From: Alvaro Herrera To: Andres Freund Cc: Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: when the startup process doesn't Message-ID: <20210420205457.GA15379@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210420202827.5qv6lji2wmmvkytc@alap3.anarazel.de> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Apr-20, Andres Freund wrote: > On 2021-04-19 13:55:13 -0400, Robert Haas wrote: > > Another possible approach would be to accept connections for > > monitoring purposes even during crash recovery. We can't allow access > > to any database at that point, since the system might not be > > consistent, but we could allow something like a replication connection > > (the non-database-associated variant). Maybe it would be precisely a > > replication connection and we'd just refuse all but a subset of > > commands, or maybe it would be some other kinds of thing. But either > > way you'd be able to issue a command in some mini-language saying "so, > > tell me how startup is going" and it would reply with a result set of > > some kind. > > The hard part about this seems to be how to perform authentication - > obviously we can't do catalog lookups for users at that time. Maybe a way to do this would involve some sort of monitoring cookie that's obtained ahead of time (maybe at initdb time?) and is supplied to the frontend by some OOB means. Then frontend can present that during startup to the server, which ascertains its legitimacy without having to access catalogs. Perhaps it even requires a specific pg_hba.conf rule. -- Álvaro Herrera Valdivia, Chile "La verdad no siempre es bonita, pero el hambre de ella sí"