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 1mD9B2-0006uW-L5 for pgsql-committers@arkaria.postgresql.org; Mon, 09 Aug 2021 17:35:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mD9B1-0007Yn-1y for pgsql-committers@arkaria.postgresql.org; Mon, 09 Aug 2021 17:35:03 +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 1mD9B0-0007YR-4r for pgsql-committers@lists.postgresql.org; Mon, 09 Aug 2021 17:35:02 +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 1mD9Aw-0001tv-RF for pgsql-committers@lists.postgresql.org; Mon, 09 Aug 2021 17:35:01 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 369F3320015C; Mon, 9 Aug 2021 13:34:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 09 Aug 2021 13:34:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=YFbdkOB37IVv4le+FX2vgIhzt58 lhIUQ1Pv7xOo1g+c=; b=i57OIspYWFUaKspHIxDjrMi8Sy+kK78B9ng4equR0zG 3kEfBhElphFpyUdqaa4HKFlYkpPOjZeiknS0cxESsWkEvrGYoM4RBq1HVuvwvBG0 KeN7is6tiDd7kDOxHjHZ+2U3HgM7bQ6Aj5u607TAv5S3U6GxOYwm72hlLJTJ++MZ 1O0E5xfD9O9km2GsZD0b2t74cblzAgX9kqONrdqWul973KGm1jNlJM1Q80ZSN2fY LLK7ntiD13HED3uQagcNTBdsvsbrywBM8ToorWzgeSjNY6ngU4/3mKk1qv/AF9p0 rQa2QHC9uVbFfWcJfMgAZER0NGOUHoOHaQ1XI+wbqmA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=YFbdkO B37IVv4le+FX2vgIhzt58lhIUQ1Pv7xOo1g+c=; b=KVEGD/OaYBJkDZPEIW+lE/ JpAprW4wvINE+8NdkkOszR9sQHEPc1ywXqpspdflqaogETd3QvbOOw/qOR3xbxMz kfFK/j29eUAp1pahLKaFQfbN8fB009b6mHD1lE6vngujvEcrwksaJjkZV5HWm4pa cAaa+k5havxcr/grOYdk93xlJ5Z6Z/gb5Byc6Qnkg48qyymxZXW4dBZLfBxhlfdH 9R/GNN/86+eixs9Cp8NXD2EmLwTc9KDnW0/wLxqNH/nWYyqiCh+5VFLcpsgMGAp9 R8YLo3U2k6bJXyJdgkj5HjmeUCFXV1XVa225gs88BYtlKSuLOt5bgLUJ8bO/3tjA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrjeejgdduudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedukefhkeelueegveetheelffffjeegleeuudelfeefuedtleffueejfffh ueffudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 Aug 2021 13:34:54 -0400 (EDT) Date: Mon, 9 Aug 2021 10:34:53 -0700 From: Andres Freund To: Robert Haas Cc: Tom Lane , pgsql-committers Subject: Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o Message-ID: <20210809173453.6fugm2z7k6uaztld@alap3.anarazel.de> References: <2638683.1628304247@sss.pgh.pa.us> <20210807030652.qf5wsbhxk7dpsmtn@alap3.anarazel.de> <2640064.1628306008@sss.pgh.pa.us> <2640490.1628306556@sss.pgh.pa.us> <20210807044952.orwuf7hua2wytx4g@alap3.anarazel.de> <20210807051149.x2j3n64ejcu23hm4@alap3.anarazel.de> <2675112.1628350987@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2021-08-09 11:46:30 -0400, Robert Haas wrote: > I think that subsystems like "memory" and "files" really ought to be > the lowest-level things we have, and should be shut down last. I don't disagree with that - but there's a difference between having that as an abstract goal, and having it a dependency of committing somebodies patch. > Stuff like "send a message to the stats collector" seems like a higher level > thing that may require those lower-level facilities in order to operate, and > must therefore be shut down first. Yep. > Maybe some subsystems need to be divided into upper and lower levels to make > this work, or, well, I don't know, something else. That's what I ended up doing, right? There's now InitFileAccess() and InitTemporaryFileAccess(). > But I'm deeply suspicious that lifting stuff like this to the front of the > shutdown sequence is just papering over the problem, and not actually > solving it. If you have a concrete proposal that you think makes sense to tie shared memory stats to, I'm happy to entertain it. One main motivator for b406478b87e etc was to allow rejiggering things like this more easily. Greetings, Andres Freund