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 1mCEcs-0000ya-6K for pgsql-committers@arkaria.postgresql.org; Sat, 07 Aug 2021 05:12:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mCEcq-0002TV-SR for pgsql-committers@arkaria.postgresql.org; Sat, 07 Aug 2021 05:12:00 +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 1mCEcq-0002TN-Ml for pgsql-committers@lists.postgresql.org; Sat, 07 Aug 2021 05:12:00 +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 1mCEcj-0003Pb-MF for pgsql-committers@lists.postgresql.org; Sat, 07 Aug 2021 05:11:59 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 1D5DD32003F4; Sat, 7 Aug 2021 01:11:52 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 07 Aug 2021 01:11:52 -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=QLjURaK62P/EXAPSXXNSpAzadMW s+SfNnxqF/074dBo=; b=EjUq5j1/IDHncxtnv5mXZcEO8MIxuYBPM03Ffb70l3R psPOdwNLzH4VVfes0n0vSSM0OpvjIxeDDNMEXD7Cu1ztxiXlAa5CCdhPs7kufBqb VIBFqU8BRKhTG94vsJkVsBXn6yjOQU+Kt3oR4R0o4Wpg/zv5TK83WRU1ks6cEjT8 NuulRwiXvQR8lYvgRsqKyZCbUGQ6P+mo1h8etVeXLS0soIX+uKSxjZDWxGyTKlJj SXPnyHlsXwTprgJLnWXCSrTOL/b4ZINWlOYHyTwwIpZ1UQOWFtlYZnWbVyl+Q8q3 HRh218xX1ATYT+BHZ3V/Qhy5/hzlpBG+0Zp0t1GZC+g== 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=QLjURa K62P/EXAPSXXNSpAzadMWs+SfNnxqF/074dBo=; b=MdWwwgdjQ+A1/6+5q7U3ek U8BzCk0NDJhPsRYo6MT4B2urTTIWlJg7ro58G2p2B6n8BmM4ptSi1G50byIEBya5 CUiAHSC1wH1+DJLxGdWChz+j0OMWjG/71HXsT9U2094hE7IbnnOu78bBBPH3bD63 IUUf1g65d10u7bYkbpY3OwDMaxDfCfxqbaci7euD/1Q0/yLKaF9tvJkKnM5eIIUZ 6rhyuKqBB7D0XFNNLpguUXzKbKRigpm+IzCTWKKCAJeZiQLt5I7CDS1yqxtin+PC 0QBbex4wWiS443jmZw8YUDr0HzFK4FcPLx1XiO8e42xoaw4kJ+wrYXiv+YAOX20g == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrjedvgdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehttdertd dttddvnecuhfhrohhmpeetnhgurhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgr rhgriigvlhdruggvqeenucggtffrrghtthgvrhhnpeevhfejveehvddvgfdtueefuefhhf etkefgfedtkefhieeuudefveduffdugfdvgeenucffohhmrghinheptghirhhruhhsqdgt ihdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 7 Aug 2021 01:11:51 -0400 (EDT) Date: Fri, 6 Aug 2021 22:11:49 -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: <20210807051149.x2j3n64ejcu23hm4@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210807044952.orwuf7hua2wytx4g@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2021-08-06 21:49:52 -0700, Andres Freund wrote: > The temp file is created by InitializeBackupManifest(). In the !OSX case, we > first abort via an ERROR, which triggers the cleanup via > WalSndResourceCleanup(). On OSX however, we immediately error out with FATAL > for some reason (timing? network buffering differences?), which will never > reach WalSndErrorCleanup(). Therefore the temp file only gets deleted during > proc_exit(), which triggers the issue... > > Not yet really sure what the best way to deal with this is. Presumably this > issue would be fixed if AtProcExit_Files()/CleanupTempFiles() were scheduled > via before_shmem_exit(). And perhaps it's not too off to schedule > CleanupTempFiles() there - but it doesn't quite seem entirely right either. Huh. I just noticed that AtProcExit_Files() is not even scheduled via on_shmem_exit() but on_proc_exit(). That means that even before fb2c5028e63 we sent pgstat messages *well* after pgstat_shutdown_hook() already ran. Crufty. Just hacking in an earlier CleanupTempFiles() does "fix" the OSX issue: https://cirrus-ci.com/task/5941265494704128?logs=macos_basebackup#L4 I'm inclined to leave things as-is until tomorrow to see if other things are shaken loose and then either commit a bandaid along those lines or revert the patch. Or something proper if we can figure it out till then. Greetings, Andres Freund