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 1sRDHW-00DtXP-0M for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Jul 2024 16:01: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 1sRDHU-00GLy6-NF for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Jul 2024 16:01: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 1sRDHU-00GLxy-AC for pgsql-bugs@lists.postgresql.org; Tue, 09 Jul 2024 16:01:28 +0000 Received: from mail-yb1-xb36.google.com ([2607:f8b0:4864:20::b36]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sRDHN-001ED3-8V for pgsql-bugs@lists.postgresql.org; Tue, 09 Jul 2024 16:01:26 +0000 Received: by mail-yb1-xb36.google.com with SMTP id 3f1490d57ef6-e0365588ab8so4936764276.1 for ; Tue, 09 Jul 2024 09:01:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1720540880; x=1721145680; darn=lists.postgresql.org; h=in-reply-to:autocrypt:content-language:from:references:cc:to :subject:user-agent:mime-version:date:message-id:from:to:cc:subject :date:message-id:reply-to; bh=+8xwzzBoGGQkdakVV/F3KN+on+IHx+EZWQTgvqhY0LU=; b=aOZXPjSFilQ5grg51HeqmJEo0b5hgCnU95aMey0DZEng1kVVOZY1MzDLz3/XPu8gWg JwwG7BHMHjFjnNQUqwEYoSCe/oZnOBux/DWPnmxOj/2DDeO7PkNkgRXYij+pA/ntTX+7 IjfIVnH3BUHJmybRBqZ+4/HyBqzKKUHkJACeqjU6UQViFyh9grjTadVJtnlhltdOL2az a0pHIeV/v5XLVGKbHMrR/OkXwcsxKNsZxgPogtTsJLEj3AyJDmGe7Y0lI0PI3u0oP8SD xjzBJaahuH/5dc7aPj1V2OYcDZoIR8nkJhRmEI1Hz4bFNL3jkDGfQs4KPbhvqPUS23QV UPAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720540880; x=1721145680; h=in-reply-to:autocrypt:content-language:from:references:cc:to :subject:user-agent:mime-version:date:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=+8xwzzBoGGQkdakVV/F3KN+on+IHx+EZWQTgvqhY0LU=; b=eq4X2TGO5CYxG8cSeLBeChTQuHMBcIWZBZa/s+JFurYg/cA3CmhnG7JHnS7g3otCQh a3oMWs+c1g5Ps7VbkovV127wHJ+dse5dhEdoSDG6SWfX/QaR8BfCkwVVVXOaSp7KwP1u J2gWiYcqrupTS5GPsvhXDM2CUQ+zOmICuYExOQBOmZf8X+MENp9LlGHxFdl9PWAduYn1 7m8r3ZaFmBgj4ZaXEOF5AY42P28LJw5F5x4WCbD5VGeDm0sZomss7chD2vE3A7w5bN02 lcvs1VBLrY+1iNumkwKucHvPljgZ2pbisg6l/vthBriGMbcEfglnq/Uo6p8+0UmkTKxo hKPA== X-Forwarded-Encrypted: i=1; AJvYcCV5l1CgOy6aPZYE4+UFq2DG9WcPr9UibymDqMayhFzKv/19AI7vHVzYi5vYjkRYySFJjcjscKkRpmIfLlTukkqRe1LmDcZ8AysHnZNH8aYC X-Gm-Message-State: AOJu0Yw/k3uq49WbTARaw4zOjjR5CxvhdiiJuV8Vz1PReMSYd4s9cFvd I6gCFjq4fImWSmYXX3zCPHst4smrABshsec2Y8tIEMYcCvCGBFHlcRMy4vSftXs= X-Google-Smtp-Source: AGHT+IG1g7MG5egxcUgNxuLDYZzNvEA5wSAtd39hG/kAKrRJLKpw7a61my118KVY+d4T91u4glvZPw== X-Received: by 2002:a5b:486:0:b0:e03:527d:34ff with SMTP id 3f1490d57ef6-e041b03ffa3mr3310729276.3.1720540879425; Tue, 09 Jul 2024 09:01:19 -0700 (PDT) Received: from ?IPV6:2605:a601:9180:9800::2bb? ([2605:a601:9180:9800::2bb]) by smtp.googlemail.com with ESMTPSA id 3f1490d57ef6-e041a981cb4sm339234276.44.2024.07.09.09.01.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Jul 2024 09:01:19 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------5daeRJKvL8XqUU9BRmNXaDkV" Message-ID: <5169f6d5-240e-49ec-9265-ddafa6e863bd@dunslane.net> Date: Tue, 9 Jul 2024 12:01:17 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pg_rewind fails on Windows where tablespaces are used To: Michael Paquier , Chris Travers Cc: Farooq Rashed , pgsql-bugs@lists.postgresql.org References: From: Andrew Dunstan Content-Language: en-US Autocrypt: addr=andrew@dunslane.net; keydata= xsBNBE7KWFkBCAClridxur2AIc7eW2AR7izbfp3EnNefie2HbLF0izW5Ik5UjX2HBXBx4syI gY6b0ugohXrr274+baoAlvSbq6cAoQuEVrk5IZFzt20b1Xkx65FwGSEj526yiKLocqkJceSq Xr9xcA5SGY+FZv441chh5SU92v4q6z+6LPpoHOh97ptAVXZYNTtU0LevyvD5lja0TzbvJm6C eFXitJfnm1pLEr0DGJCR/iUOl/N62Kh4855zZC7NHIjQHPOvV5Stz/l5ilDhvGVk+xkXFPys SjZoUr1rXhYLpiyi5sR0X9FHXT0KnGuz1F5ERO7ZTLSSQ6fJwPj6gOk9K+vvoKvoeql5ABEB AAHNJEFuZHJldyBEdW5zdGFuIDxhbmRyZXdAZHVuc2xhbmUubmV0PsLAmwQTAQgARQIbAwIX gAIZAQULCQgHAgMiAgEGFQoJCAsCBBYCAwEC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DTgxHRzC1jgQNidyd6tKqcsVJs0dzF0oKTmFFmUAqTdJO12LBuNA1rlqrR3EtpYk8B/wtS 5dIMD7Q8hwQpL+4C6GNpb6ZKnPkLi47pDOLhz2qBrqN+rqUEsT3YnExYpzj5yOBi+FlmV1Hw 49QYe1sn2ZPs In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------5daeRJKvL8XqUU9BRmNXaDkV Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024-06-04 Tu 12:53 AM, Michael Paquier wrote: > 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. When >> 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 timeline >> 2 >> pg_rewind: error: file "pg_tblspc/34244696" is of different type in source >> and target >> >> 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. An EDB customer has encountered the same issue. They are not using in-place tablespaces. I have reproduced this problem on release 15, not using an in-place tablespace. The solution I came up with was to backpatch commits c5cb8f3b, 387803d8 and 5fc88c5d53. I don't think we need to do anything relating to in-place tablespaces. These are documented as a developer only option and not for production. The only question in my mind is whether those patches should be backpatched. It's a couple of hundred lines, and I think it's safe, but I'd welcome other opinions. If we are going to backpatch them we should also look at adding to adding tests for use of tablespaces with pg_rewind on the back branches. Ideally we'd get this done in time for the next maintenance release. cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------5daeRJKvL8XqUU9BRmNXaDkV Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


On 2024-06-04 Tu 12:53 AM, Michael Paquier wrote:
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.  When
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 timeline
2
pg_rewind: error: file "pg_tblspc/34244696" is of different type in source
and target

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.


An EDB customer has encountered the same issue. They are not using in-place tablespaces.

I have reproduced this problem on release 15, not using an in-place tablespace.

The solution I came up with was to backpatch commits c5cb8f3b, 387803d8 and 5fc88c5d53.

I don't think we need to do anything relating to in-place tablespaces. These are documented as a developer only option and not for production.

The only question in my mind is whether those patches should be backpatched. It's a couple of hundred lines, and I think it's safe, but I'd welcome other opinions. If we are going to backpatch them we should also look at adding to adding tests for use of tablespaces with pg_rewind on the back branches. Ideally we'd get this done in time for the next maintenance release.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com
--------------5daeRJKvL8XqUU9BRmNXaDkV--