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 1mCRQE-0008Qs-Kt for pgsql-committers@arkaria.postgresql.org; Sat, 07 Aug 2021 18:51:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mCRQD-0006vO-Hn for pgsql-committers@arkaria.postgresql.org; Sat, 07 Aug 2021 18:51:49 +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 1mCRQC-0006vG-1r for pgsql-committers@lists.postgresql.org; Sat, 07 Aug 2021 18:51:49 +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 1mCRQ9-00013v-8s for pgsql-committers@lists.postgresql.org; Sat, 07 Aug 2021 18:51:47 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 68A3F3200901; Sat, 7 Aug 2021 14:51:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 07 Aug 2021 14:51:43 -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=MsmMTx22UK18kDyz7nHQgmcq8Km GYSarS1Y9R1Wizvw=; b=mvMYOS0r5EPH+W8rBoshYaPl9KOE2ULAnRIt8Aejh7p 3CpRALs8ibCmrX/sEd49nbt+Zw6RIIdAtJEL7lJxhvjQscqggo+Wb5+JaBl0EOxT 8nvHnXSV95c42pEj1LPSIhE6kdve8DFHhN6OUCK80IBlxp+c/YmWOPrQwf9O8ZrL zR/ztaUHd6FJiCkebT50s9HVhInJ4BHWhpxHGW4Qk2oiyou17aft+xxJSDDx6reh bkMBklSaUQOqfxp+P4IGSEK3H4xq7rFdgOEjvhyYlvOowiVotHJyBldNonz4vhR4 UHW/klmofamFWX36O8KVtHhSVmWGoMnzZaPfFIGtbnQ== 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=MsmMTx 22UK18kDyz7nHQgmcq8KmGYSarS1Y9R1Wizvw=; b=q5sCH3GPsyxNiWMYPiToNP IEcspQZjrQIZLdDbh+xWQ+807o8EnDGrb3XAJQZfQnYVMmIsQVc8AYyAM1qSRBxa X2q1BEXYmwSoz+MMJ6rZAin/QtzgNj0D5mh3Ebts5bjrlM6ld0JAiSThq3nlh+h/ H24tXPF8BBjfvbbNvFiwyNIlfC9YPUxPzoJ9beFQ05Ghu284rLhuYE+hvgLYwbuS C7f+e3/8Iwbsza4lOadh/xFNA4ihWd+4fU+kKYLUI3LbVnFBbwqOS8PRvzjsH8/h f0prmQTNNDNtKVT23CWvbbM11Y5FX3EytBUpEjqPi6YBQtJguuZo8Ghc2vdrFIXQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrjeefgdduvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujgesthdtre dttddtvdenucfhrhhomheptehnughrvghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghn rghrrgiivghlrdguvgeqnecuggftrfgrthhtvghrnhepudekhfekleeugeevteehleffff ejgeelueduleeffeeutdelffeujeffhfeuffdunecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 7 Aug 2021 14:51:42 -0400 (EDT) Date: Sat, 7 Aug 2021 11:51:41 -0700 From: Andres Freund To: Tom Lane Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o Message-ID: <20210807185141.ncmuxchr6d2qv2v6@alap3.anarazel.de> References: <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> <20210807164850.52atvo2qkmtfnzgt@alap3.anarazel.de> <2771326.1628356007@sss.pgh.pa.us> <20210807172556.rda5m7jjhk7ktukl@alap3.anarazel.de> <2782786.1628357836@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2782786.1628357836@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2021-08-07 13:37:16 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2021-08-07 13:06:47 -0400, Tom Lane wrote: > >> Fair. But I suggest that the first cut should look more like what > >> I suggest above, ie just be willing to lose events during shutdown. > >> The downsides of that are not so enormous that we should be willing > >> to undertake major klugery to avoid it before we've even got a > >> semi-working system. > > > I think that's more likely to hide bugs unfortunately. Consider fa91d4c91f2 - > > I might not have found that if we had just ignored "too late" pgstats activity > > in pgstats.c or fd.c, and that's not an edge case. > > Depends what you want to define as a bug. What I am not happy about > is the prospect of random assertion failures for the next six months > while you finish redesigning half of the system. The rest of us > have work we want to get done, too. I don't object to the idea of > making no-lost-events an end goal, but we are clearly not ready > for that today. I don't know what to do about that. How would we even find these cases if they aren't hit during regression tests on my machine (nor on a lot of others)? Obviously I had ran the regression tests many times before pushing the earlier changes. The check for pgstat being up is in one central place and thus easily can be turned into a warning if problems around the shutdown sequence become a frequent issue on HEAD. If you think it's better to turn that into a WARNING now and then arm into an assert later, I can live with that as well, but I don't think it'll lead to a better outcome. The shared memory stats stuff isn't my personal project - it's Horiguchi-san's. I picked it up because it seems like an important thing to address and because it'd been in maybe a dozen CFs without a lot of progress. It just turns out that there's a lot of prerequisite changes :(. Greetings, Andres Freund