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 1oCK2U-0000N7-Ru for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Jul 2022 12:03:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oCK2S-0002KO-RO for pgsql-hackers@arkaria.postgresql.org; Fri, 15 Jul 2022 12:03:20 +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 1oCK2S-0002KE-I7 for pgsql-hackers@lists.postgresql.org; Fri, 15 Jul 2022 12:03:20 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oCK2O-0007Hb-3p for pgsql-hackers@postgresql.org; Fri, 15 Jul 2022 12:03:19 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 66DE65C003E; Fri, 15 Jul 2022 08:03:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 15 Jul 2022 08:03: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:feedback-id:feedback-id: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; t=1657886593; x=1657972993; bh=2 KPA3NEOs49jY+LJR5hFjNkTJJYDU3vi8wUIEvX/nsc=; b=GW6KC13E92ZCGhKsc Cu0itrrheDqSvdKtMStANM0z8tEu7FOkhqDoXX8ksVd31GMdND4puycJjXoEZYll YtpypEeW5M1BhCO0bFJnvDPZWcEZP4tc5qpwPr/iVE1BH1Urwu0c58vO5yC4iyhU bVDwFpXm4jIddC8JZqpG3/b3f7cgp5lixVpzjbRkfuG8uSd3iddod6nuT2bOCgF9 vI5JbzRh/gMzzkJMeIEOGuin7MDFc5RgjtAtPjO4TKyWZyxF4/m9KkHonaALtBqP jwM8cmsxHvRg6vT1RuhjMUmoXdEkNGEDL7/k99447S5RFNvoZprFaroqdNvfBlYK XMyQg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudekuddggeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfggtggugfgjsehtke ertddttdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhr vgesrghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpeekteeuvddthf euiedtfefgkedvgfdtveduudefiedtkeehfeduvdehgeevhfeffeenucffohhmrghinhep tghirhhruhhsqdgtihdrtghomhdpvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv segrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 15 Jul 2022 08:03:12 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id D724436E; Fri, 15 Jul 2022 14:03:11 +0200 (CEST) Date: Fri, 15 Jul 2022 14:03:11 +0200 From: Alvaro Herrera To: Kyotaro Horiguchi Cc: dilipbalaut@gmail.com, 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: <20220715120311.3z6g2nqqdtiurlbp@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220715105844.e5iuer7bav4chdnl@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Jul-15, Alvaro Herrera wrote: > However, looking closer I noticed that on Windows we use our own > readdir() implementation, which AFAICT includes everything to handle > reparse points as symlinks correctly in get_dirent_type. Which means > that do_pg_start_backup is wasting its time with the "#ifdef WIN32" bits > to handle junction points separately. We could just do this > > diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c > index b809a2152c..4966213fde 100644 > --- a/src/backend/access/transam/xlog.c > +++ b/src/backend/access/transam/xlog.c > @@ -8302,13 +8302,8 @@ do_pg_backup_start(const char *backupidstr, bool fast, TimeLineID *starttli_p, > * we sometimes use allow_in_place_tablespaces to create > * directories directly under pg_tblspc, which would fail below. > */ > -#ifdef WIN32 > - if (!pgwin32_is_junction(fullpath)) > - continue; > -#else > if (get_dirent_type(fullpath, de, false, ERROR) != PGFILETYPE_LNK) > continue; > -#endif > > #if defined(HAVE_READLINK) || defined(WIN32) > rllen = readlink(fullpath, linkpath, sizeof(linkpath)); > > And everything should continue to work. Hmm, but it does not: https://cirrus-ci.com/build/4824963784900608 -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/