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 1nZAA8-0001Eq-Ii for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Mar 2022 11:37:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nZAA7-0002De-B2 for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Mar 2022 11:37:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZAA6-0002DV-D8 for pgsql-hackers@lists.postgresql.org; Tue, 29 Mar 2022 11:37:23 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZAA2-0005ox-8l for pgsql-hackers@postgresql.org; Tue, 29 Mar 2022 11:37:22 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 606E232021A2; Tue, 29 Mar 2022 07:37:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 29 Mar 2022 07:37:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=XZWo9hTKlkV1HlgolyseUJFOt+r5yB9yPV3q9fKTLhM=; b=B5VreMeT 3dST/BWK1RUoNmjbiRU0PML3h76pugbX4FIdrKTkkA2oUtPLqXaFtbU++6UoWzQ+ rvABnmqMXYQ6zhJuAD5xYDU+ZT0MH7CMOW8cxxgdRMneUBmXL2SE1MSpcZEDelPm Ey4huaB8FMSS9D/1MFisdfik+RfNgv2ixE7P/26Na84CDMyidtfVo48UU50QdOQy YEyrDzuO+H6N+HppX1rWcnW3cFa7/Wpgwz5LDM+Nslt/sdHLTJOIsyMq4jGAL0bh lHxiTjAaGrOGFc1I6rVl/d857WhuL0RWwWgMu0qv2mBoSDurpxwSFgJaffWyuyQo eirmgUQ6T/kU+Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeitddgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkgggtugfgjgesthekre dttddtjeenucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgv segrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepudejveejffejve duudetvdekieeuiedtvdeileefkeevjedufeeguedvjefhueelnecuffhomhgrihhnpegv nhhtvghrphhrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 29 Mar 2022 07:37:12 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id C572F2A0AE5; Tue, 29 Mar 2022 08:37:34 -0300 (-03) Date: Tue, 29 Mar 2022 13:37:34 +0200 From: Alvaro Herrera To: Kyotaro Horiguchi Cc: robertmhaas@gmail.com, michael@paquier.xyz, rjuju123@gmail.com, pgsql-hackers@postgresql.org Subject: Re: standby recovery fails (tablespace related) (tentative patch and discussion) Message-ID: <202203291137.ys7fq7g4ehte@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220329.135535.310000883119475499.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Mar-29, Kyotaro Horiguchi wrote: > > That's going to result in a call to > > XLogReadBufferForRedoExtended() which will call > > XLogReadBufferExtended() which will do smgrcreate(smgr, forknum, true) > > which will in turn call TablespaceCreateDbspace() to fill in all the > > missing directories. > > Right. I thought that recovery avoids that but that's wrong. This > behavior creates a bare (non-linked) directly within pg_tblspc. The > directory would dissapear soon if recovery proceeds to the consistency > point, though. Hmm, this is not good. > No. I agree that mixing them is not good. On the other hand we > already doing that by heapam. AFAICS sometimes it avoid creating a > new page but sometimes creates it. But I don't mean to use the fact > for justifying this patch to do that, or denying to do that. I think we should revert this patch and do it again using the other approach: create a stub directory during recovery that can be deleted later. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "Porque francamente, si para saber manejarse a uno mismo hubiera que rendir examen... ¿Quién es el machito que tendría carnet?" (Mafalda)