Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEMAq-0011jy-Jj for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Jun 2024 04:53:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sEMAq-00FE0n-9H for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Jun 2024 04:53:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEMAo-00FDyZ-Rz for pgsql-bugs@lists.postgresql.org; Tue, 04 Jun 2024 04:53:28 +0000 Received: from wfhigh3-smtp.messagingengine.com ([64.147.123.154]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEMAl-003Lyv-JY for pgsql-bugs@lists.postgresql.org; Tue, 04 Jun 2024 04:53:25 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.west.internal (Postfix) with ESMTP id 07C491800084; Tue, 4 Jun 2024 00:53:20 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 04 Jun 2024 00:53:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1717476800; x=1717563200; bh=MN4t+k7070 HQ+yz2msDm/jlhYXRAusAyVu4LsAJr4gc=; b=AZrIEOnuV/m5rmX2atZ7SqJxXx xBM1GJJ7udWhp8Istf9APrt0tvF18jUHaPOhUat61ICpQV+jSGREToSld9lnCYns I+TbFe12VJyYBmnm2k8W7HsvniLGFE/uOzckBrGaG1WGAhy7jjfS8gZNn57tc68j 9LF+FEJDUfXc9+7EdfGriYnWRKAOVdJPaaDJ1wvqxiPwqVq+RfnYQELQ96NXvDpa rJRCmp1T6Wfblyg0PDjyVZWPDx8gULHxF5CPh/3rPehhoh7mhgZT5nCDDzGWdoqm Ncfou+ub2WapeYVNInRthhX+OpouaMU2Fgg21yumv+ZU+DxuGoGbjoDwsGsw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1717476800; x=1717563200; bh=MN4t+k7070HQ+yz2msDm/jlhYXRA usAyVu4LsAJr4gc=; b=CLEfqJBVL1Sq2qvZ9KoHxQPPqOLqMORVfuFW/NrGal30 rMYGwavNPlkSIQUJkKYwjMAIWVg3T4VJvakL3S2HLjOyylxygYYzUoBLrC2Wj2XQ Wn4ru+R5GH8k7khlGcJnvWuHBfTnksvc/Q2+iMbnYpWzyUvSgMHU5TJ5kePNp8Tq lP+wR3h8g75l0zmbc4ENCiilvdspuOPk4jOXb1aHIm/37hjYJF4MOfx24CMCVk8Z wD4ODgru7cQgVAZV9OF2XwqSF6b5tF+N8Lao5wjWIj6zcpHHmI8T+Oz2UCNFfMBl TXnbkYTFKgqAjDcqd2OjhTG19OWrKTnHl93fIzYFfA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdelfedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlvdefmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnheptdeifeeivdffheekfefggefg jeehfefffffhkeekieettdehveevkeetkedufefhnecuffhomhgrihhnpehpohhsthhgrh gvshhprhhordgtohhmpdhpohhsthhgrhgvshhqlhdrohhrghenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivg hrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 Jun 2024 00:53:18 -0400 (EDT) Date: Tue, 4 Jun 2024 13:53:04 +0900 From: Michael Paquier To: Chris Travers Cc: Farooq Rashed , pgsql-bugs@lists.postgresql.org Subject: Re: pg_rewind fails on Windows where tablespaces are used Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ZOV3GiYUm21DClSB" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ZOV3GiYUm21DClSB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 08, 2024 at 03:02:21PM +0700, Chris Travers wrote: > Setup is PostgreSQL on Windows with a tablespace on a separate drive. Wh= en > I go to run pg_rewind it consistently fails with the following error: (Chris has poked me regarding this issue last week in Vancouver.) > pg_rewind: servers diverged at WAL location 39B/7EC6F60 on timeline 2 > pg_rewind: rewinding from last common checkpoint at 39B/7E8E3F8 on timeli= ne > 2 > pg_rewind: error: file "pg_tblspc/34244696" is of different type in source > and target >=20 > The file is confirmed to be a JUNCTION to the correct location on both the > source and target. So the error looks like a problem interacting with > Windows and detecting JUNCTION types in this case. I am not completely sure to follow here. Aren't you making use of an in-place tablespace here? Could you provide more details about the structure of the data folders, because these are on separate hosts, right? When rewinding from a live server, readlink() returns an absolute path for a junction point, meaning that the result would not be influenced by bf227926d22b as we would always handle such an entry with FILE_TYPE_SYMLINK. On Windows, the link creation would be covered by pgsymlink(), which would create the link as a junction point. Note that I do not object to a backpatch of bf227926d22b, as I did not do it for the sake of caution as in-place tablespaces are a developer feature. If you use it for tests of your own on stable branches, well, why not. > I came across the following which looks like it would fix this problem but > don't have a proper build environment. Please consider backporting the f= ix > at least as far as Postgres 15 as this bug fix does apply to non-in-place > tablespaces on Windows. The thread is > https://postgrespro.com/list/thread-id/2657122 I'd suggest to use the postgresql.org reference. This refers to commit bf227926d22b, for the following thread: https://www.postgresql.org/message-id/2b79d2a8-b2d5-4bd7-a15b-31e485100980.= xiyuan.zr@alibaba-inc.com Thanks, -- Michael --ZOV3GiYUm21DClSB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmZenbAACgkQnvQgOdby QH0v5xAAo3IIOZE0WWWTfWOyQT7Z54R3mcp0tx3yNPMlKJFLHNpwNvxmE8TtaHVq mEg+GnD1Jvr7KelNYNjO32hH2p4Cd67EZ2KHOd3SsgR93cZJdntISOK0/si3D2i/ En3fRh1xOwbPkLPIG+6WsokZuUPnUNIrxxEp04eBHuXuM7nRvp6ma9BDseqpoFJT 2IFJkZCBbbCrCS6f0WBeQ9iwLO5SQs3ch99NjZ+g4VrVyXOfSLg2/lJ5DwWkO08r V/A2lZBUp+JoJWRqcA3l10MazMZCGPWTmxpQDilIPNDn+55tPTwPIhoBRttURILd SdvJOgjD+jq5HXggovXtcpHsPbgKVMXt4FWNqt9auwnVmRx+NeXSsA+uQdI/fsLx q14Aux/Bx1Q9DUBl20PaJBnUHqnKtoPLU8CgmPsqtKvZhNLV9XkVobcaV/5/lvQA F5wlYPmLXZmq2ox0pkXiQyfwo7OBPmSjJF2sMiljtcmgUWxjTi6PYL/X/FAk1A8X Wh6jLKgnErAF6jXVD1dA/ih+XA3SHHQILXRVIhgeejnjox4nr7xhrUYm4U31P5Qi YE6GTUjhMASs8wjTyrBDMzQWb3tf/bKW7F9K75NB1hCIpONyNwNhjfCrBvM/69Ul zjs6e3cTBLuSi1z9qHRdPHCxYLkJ7/hWUvumO2TKHtR+RtBiMps= =WySC -----END PGP SIGNATURE----- --ZOV3GiYUm21DClSB--