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 1r2B9h-00FNNN-9u for pgsql-hackers@arkaria.postgresql.org; Sun, 12 Nov 2023 14:09:41 +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 1r2B9e-00Af5N-1N for pgsql-hackers@arkaria.postgresql.org; Sun, 12 Nov 2023 14:09:38 +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 1r2B9d-00Af5F-FU for pgsql-hackers@lists.postgresql.org; Sun, 12 Nov 2023 14:09:37 +0000 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1r2B9V-005DYf-Qh for pgsql-hackers@postgresql.org; Sun, 12 Nov 2023 14:09:35 +0000 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3b2df2fb611so2507123b6e.0 for ; Sun, 12 Nov 2023 06:09:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1699798168; x=1700402968; darn=postgresql.org; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=0nHkYzpNFDDYsgaLeb8JhLwBi8x+z+G0Bsm/xuHrfGU=; b=RgxoolKhZzYcfsDT8QIvuQSS5I2euU0MMtlYfSJSMRMzxIVG5M1MTdxQQ7lWcU+C1N sMfIV5KOQNpAE2rHY9miHwYQwxAIXCcu14y5e2vas8Kzevrk30Pi20/HBML7Sp3XRvmF Ec2WOYD1+NltY3velbFMNyUQFjuFi0wysYRbLVzcTla283hNwqVHu/tDF1Ufgw8VzX7f W0n5nAji2j7czLoYTb+jHBZfC8LARMhVpc6sldTXk5d0zC+aWllpBFv9ydkpAisSGqIv +WZk/u+mk7P0xPrr0OYx5f/Yk4Qa8aCoQwQqUk/BLr2XoQLfBpINzUkIq8Q9Ny+6673u AHIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699798168; x=1700402968; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=0nHkYzpNFDDYsgaLeb8JhLwBi8x+z+G0Bsm/xuHrfGU=; b=ZyeDmnupnTwNKJRRXcyRb7H4nrwdhteZzes/+bYQfG7p1Of/hp0EZPLuhC8ZVp1ZgM ckJOJ/WnpYWuUeQnYzmG7O+Dw1F+EImOpxDfowiNAnXOlWCOwwwt/Q+J47h0XAKHeklh 45+/rhqe24lyoNUYfZRZKt+/UBbZJoiUrz8tCezaLCDQgV4bpjhvmw6COFd9kIj1vVSJ qkLevcXkadtmiHCWvmBfRZSVrzWL7i/v/Plj8Z0E/vGcU8RJS+kLqXmM8f6y7tAeZ31R VR4rhQJzkEGHz/dNdIeRbpr0cTOyyVgGf2NZuzjOviR7CQlJFSNwi/mzM5AM+/MZ3Wss 3vzw== X-Gm-Message-State: AOJu0YygEDPuvu9xl3ci4qGo3dcwWn8q36n0/YfdFQWBFiAZlkgeC0Rq rRBeNGaCRG8GSKDt0+ifBe7FH21VpDTZ4kBSo54= X-Google-Smtp-Source: AGHT+IEMxssRl8yowClIfM+xz+Ddhwe58KdzIIr2+pC1T9W8/sEAUyNexwZQDT2R8PrKoOg3PT7EZw== X-Received: by 2002:a05:6870:5314:b0:1ea:7bd1:c48d with SMTP id j20-20020a056870531400b001ea7bd1c48dmr6858279oan.49.1699798168469; Sun, 12 Nov 2023 06:09:28 -0800 (PST) Received: from ?IPV6:2605:a601:9122:d800::2bb? ([2605:a601:9122:d800::2bb]) by smtp.googlemail.com with ESMTPSA id t1-20020a056214154100b0064f4ac061b0sm1299280qvw.12.2023.11.12.06.09.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Nov 2023 06:09:27 -0800 (PST) Content-Type: multipart/alternative; boundary="------------na0rDCNy9cAnekxIvRii7oCg" Message-ID: Date: Sun, 12 Nov 2023 09:09:27 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: pg_basebackup check vs Windows file path limits Content-Language: en-US To: Alexander Lakhin , Daniel Gustafsson Cc: PostgreSQL Hackers References: <666ac55b-3400-fb2c-2cea-0281bf36a53c@dunslane.net> <76f33a1f-ddce-80a6-6f39-fefa0668f4a6@dunslane.net> <3AC47E65-02A0-42BF-8A3E-B38FD09FE702@yesql.se> <94341cbe-9491-60e9-f01a-7ed770295cfa@dunslane.net> <81023744-772d-889b-99b8-bd1d58bd761b@dunslane.net> <67093EFC-3800-48B0-9E20-82A37A5F2A7B@yesql.se> <0c1c289c-f55a-1cc3-4ce1-44d7e8353e70@dunslane.net> <3B1D0F8A-DB97-462A-937F-73B3FCFE2713@yesql.se> <8e3130c2-5c51-5cd5-9f0d-b0cd938bcd6b@dunslane.net> <13663265-cac2-ec5d-d378-0dd44a895f8e@gmail.com> <9293e623-1d5e-0bd3-9b61-6129821b6f42@dunslane.net> <6aa7c5a0-a4c8-dd2c-3a99-946eb7f23155@gmail.com> From: Andrew Dunstan In-Reply-To: <6aa7c5a0-a4c8-dd2c-3a99-946eb7f23155@gmail.com> 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. --------------na0rDCNy9cAnekxIvRii7oCg Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2023-11-11 Sa 12:00, Alexander Lakhin wrote: > 11.11.2023 18:18, Andrew Dunstan wrote: >> >> Hmm, maybe we should be using File::Copy::move() instead of rename(). >> The docco for that says: >> >>         If possible, move() will simply rename the file. Otherwise, it >>         copies the file to the new location and deletes the original. If an >>         error occurs during this copy-and-delete process, you may be left >>         with a (possibly partial) copy of the file under the destination >>         name. > > Unfortunately, I've stumbled upon inability of File::Copy::move() > to move directories across filesystems, exactly as described here: > https://stackoverflow.com/questions/17628039/filecopy-move-directories-accross-drives-in-windows-not-working > > (I'm sorry for not looking above rename() where this stated explicitly: > # On Windows use the short location to avoid path length issues. > # Elsewhere use $tempdir to avoid file system boundary issues with moving. > So this issue affects Windows only.) > > *sigh* A probable workaround is to use a temp directory on the same device the test is building on. Just set it up and set your environment TEMPDIR to point to it, and I think it will be OK (i.e. I havent tested it). But that doesn't mean I'm not searching for a better solution. Maybe Alvaro's suggestion nearby will help. cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------na0rDCNy9cAnekxIvRii7oCg Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 2023-11-11 Sa 12:00, Alexander Lakhin wrote:
11.11.2023 18:18, Andrew Dunstan wrote:

Hmm, maybe we should be using File::Copy::move() instead of rename(). The docco for that says:

        If possible, move() will simply rename the file. Otherwise, it
        copies the file to the new location and deletes the original. If an
        error occurs during this copy-and-delete process, you may be left
        with a (possibly partial) copy of the file under the destination
        name.

Unfortunately, I've stumbled upon inability of File::Copy::move()
to move directories across filesystems, exactly as described here:
https://stackoverflow.com/questions/17628039/filecopy-move-directories-accross-drives-in-windows-not-working

(I'm sorry for not looking above rename() where this stated explicitly:
# On Windows use the short location to avoid path length issues.
# Elsewhere use $tempdir to avoid file system boundary issues with moving.
So this issue affects Windows only.)



*sigh*

A probable workaround is to use a temp directory on the same device the test is building on. Just set it up and set your environment TEMPDIR to point to it, and I think it will be OK (i.e. I havent tested it).

But that doesn't mean I'm not searching for a better solution. Maybe Alvaro's suggestion nearby will help.


cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com
--------------na0rDCNy9cAnekxIvRii7oCg--