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 1r1nas-00Dj4s-FC for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Nov 2023 13:00:10 +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 1r1nap-007Snr-UK for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Nov 2023 13:00:07 +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 1r1nap-007Sni-GE for pgsql-hackers@lists.postgresql.org; Sat, 11 Nov 2023 13:00:07 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1r1nam-0053tH-Sw for pgsql-hackers@postgresql.org; Sat, 11 Nov 2023 13:00:06 +0000 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-507bd64814fso4213839e87.1 for ; Sat, 11 Nov 2023 05:00:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699707603; x=1700312403; 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=h+kWPkHfGB3WgwMM1t2DyNcNlGawyzGMWRPxapUGwU8=; b=QuJQNFJRkk/v+CL4B5tyou6lO/YXCueMN3GyQq8qJt6Ur2uQ6DG0g1u9Azm4SSFmo2 p/COYyKOtbx8hqp88xkxN72VFudcQMnsEj4RkXqtREIwAOUTsg8CuihAE7VlqLdmDKeb 84jn6tD+2BPEZmPBECu/CykS/pmlFyZiWjErThfyTOTKZmYd1LWDpp7NSIigoO5zFltd 6LAOhaiQFRjItt6u00zAF++a62HxPgMyAfPyUq0kljmI0SWmPDgJu+mRHRNl1twkKONg Qkos8/FyRqIWFgNQysiOLhkeehlegMf6chDgVHzrHgvXVCRT+65MclzsC+mv+dawpeio hE1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699707603; x=1700312403; 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=h+kWPkHfGB3WgwMM1t2DyNcNlGawyzGMWRPxapUGwU8=; b=n1jScxwzLjUuScFSVEglvYhcLQTCJei0ccZUNRH3kEKX/zrly3O5XNdcn3Cm2DCunY UN1UymKFsGA1jtLdqRTb5G965922exwnsnfl+yrD+5p+iYTt7L3xspRc9ZdUk0Yo96EJ vEEmKOaIwHtj7gesjH19HAX0N0aW0pH9TuHoM60tWfAmXBHeOmk4m14Bj9Oy7Dqy2lR3 +aPrMsqT82oLyr532ZBkv640RKL/RG6hjSWKhu3HOAqllSg8iBsVj/XGkWsiO/Vwd9v9 1JKtZc0mH2/HE9tMuSEQZMN3zMRCMaDvxXljCDsR412aXgk1fh5GdB8HUOpRRaTFG7sg e+eQ== X-Gm-Message-State: AOJu0Yy/1C7c8jK0E7pJVzBbSQvtZt6BJpkvDTi9M85lydTyxj9A8KtI scR+ChmWpe8XBBYLMfS1W4k= X-Google-Smtp-Source: AGHT+IGyeej+kI1xtaaUnCpoul2fP9pbPoU3KTiV6GS7Jm1XYknRzCe1+BEviQ9W0GOdjHzd+/FHYQ== X-Received: by 2002:ac2:54a1:0:b0:500:9a29:bcb8 with SMTP id w1-20020ac254a1000000b005009a29bcb8mr1222431lfk.4.1699707602918; Sat, 11 Nov 2023 05:00:02 -0800 (PST) Received: from [1.0.0.7] ([178.155.25.100]) by smtp.gmail.com with ESMTPSA id b6-20020a0565120b8600b00502e2ab7118sm271191lfv.50.2023.11.11.05.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 11 Nov 2023 05:00:02 -0800 (PST) Content-Type: multipart/alternative; boundary="------------kVII1vhz9pXfgoIr6fm2hLVe" Message-ID: <13663265-cac2-ec5d-d378-0dd44a895f8e@gmail.com> Date: Sat, 11 Nov 2023 16:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: pg_basebackup check vs Windows file path limits Content-Language: en-US To: Andrew Dunstan , 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> From: Alexander Lakhin 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. --------------kVII1vhz9pXfgoIr6fm2hLVe Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hello Andrew, 08.07.2023 18:52, Andrew Dunstan wrote: >> Since this test is passing on HEAD which has slightly shorter paths, I'm wondering if we should change this: >> >> rename("$pgdata/pg_replslot", "$tempdir/pg_replslot") >>   or BAIL_OUT "could not move $pgdata/pg_replslot"; >> dir_symlink("$tempdir/pg_replslot", "$pgdata/pg_replslot") >>   or BAIL_OUT "could not symlink to $pgdata/pg_replslot"; >> >> to use the much shorter $sys_tempdir created a few lines below. >> > Pushed a tested fix along those lines. > Today I've started up my Windows VM to run some tests and discovered a test failure caused by that fix (e213de8e7): >meson test Ok:                 246 Expected Fail:      0 Fail:               1 Unexpected Pass:    0 Skipped:            14 Timeout:            0 ...\010_pg_basebackup\log\regress_log_010_pg_basebackup.txt contains: [04:42:45.321](0.291s) Bail out!  could not move T:\postgresql\build/testrun/pg_basebackup/010_pg_basebackup\data/t_010_pg_basebackup_main_data/pgdata/pg_replslot With a diagnostic print added before rename() in 010_pg_basebackup.pl, I see: rename("T:\postgresql\build/testrun/pg_basebackup/010_pg_basebackup\data/t_010_pg_basebackup_main_data/pgdata/pg_replslot", "C:\Users\User\AppData\Local\Temp\fGT76tZUWr/pg_replslot") That is, I have the postgres source tree and the user tempdir placed on different disks. perldoc on rename() says that it usually doesn't work across filesystem boundaries, so I think it's not a Windows-specific issue. Best regards, Alexander --------------kVII1vhz9pXfgoIr6fm2hLVe Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Hello Andrew,

08.07.2023 18:52, Andrew Dunstan wrote:
Since this test is passing on HEAD which has slightly shorter paths, I'm wondering if we should change this:
rename("$pgdata/pg_replslot", "$tempdir/pg_replslot")
  or BAIL_OUT "could not move $pgdata/pg_replslot";
dir_symlink("$tempdir/pg_replslot", "$pgdata/pg_replslot")
  or BAIL_OUT "could not symlink to $pgdata/pg_replslot";

to use the much shorter $sys_tempdir created a few lines below.

Pushed a tested fix along those lines.


Today I've started up my Windows VM to run some tests and discovered a test
failure caused by that fix (e213de8e7):
>meson test
Ok:                 246
Expected Fail:      0
Fail:               1
Unexpected Pass:    0
Skipped:            14
Timeout:            0

...\010_pg_basebackup\log\regress_log_010_pg_basebackup.txt contains:
[04:42:45.321](0.291s) Bail out!  could not move T:\postgresql\build/testrun/pg_basebackup/010_pg_basebackup\data/t_010_pg_basebackup_main_data/pgdata/pg_replslot

With a diagnostic print added before rename() in 010_pg_basebackup.pl, I see:
rename("T:\postgresql\build/testrun/pg_basebackup/010_pg_basebackup\data/t_010_pg_basebackup_main_data/pgdata/pg_replslot", "C:\Users\User\AppData\Local\Temp\fGT76tZUWr/pg_replslot")
That is, I have the postgres source tree and the user tempdir placed on
different disks.

perldoc on rename() says that it usually doesn't work across filesystem
boundaries, so I think it's not a Windows-specific issue.

Best regards,
Alexander
--------------kVII1vhz9pXfgoIr6fm2hLVe--