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.96) (envelope-from ) id 1vuwIi-00DlZ6-2D for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Feb 2026 17:34:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vuwIg-002cXH-13 for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Feb 2026 17:34:22 +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.96) (envelope-from ) id 1vuwIg-002cX8-0E for pgsql-bugs@lists.postgresql.org; Tue, 24 Feb 2026 17:34:22 +0000 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vuwIc-00000000zYQ-3lVw for pgsql-bugs@lists.postgresql.org; Tue, 24 Feb 2026 17:34:20 +0000 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-7d4c1d2123dso5829135a34.2 for ; Tue, 24 Feb 2026 09:34:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771954459; x=1772559259; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=cf1KQxsYJVBrsra8oxFsbNtnugue7uudN+opLw9EKcI=; b=A5INjWhG136HRN4z/C5vAkaWnRP5CEkenlMCZVJLjpiRAsC7szddtgAeHpRwgDaJuO srZLxCEcxy5IMTCen99poDE9apt5x8w1atNcNXpkqzO4FIJXQAvHpsOQ7DiZttdO5JeP msjoGgyrgWN5z0+XhH0Vpi2a+cXiaUD3r9WcZKQvGYMQAdyYWX69yWB7SzbKuyklO+Ni yLb1Vr7ccADkqqU9E6DKelhigZ1F7kfh5FWruz7FPjhuIgpwBRaPF62tmUMdDB8q4gDn EG290FGzpYwnrs6aM2y9s/8AcXssiSYBzHS5GgCGXDVYjc7W8IinHlb4XHBmQUppIR8R 5+nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771954459; x=1772559259; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cf1KQxsYJVBrsra8oxFsbNtnugue7uudN+opLw9EKcI=; b=exp9ad0oZQvxYBj/fkcNWbsfWGsoZU/XjjfjrLX+b/T8+mjwMEAZI5xQLneK8H9bWg jJxKF5rfuPSPsMNmzzZn4rW2wJP9qGtb3ULRGcWATytQgTLV063fO9VAmEtj/F6FCZGK gSZW7+rHN5JyjhN9Qp91LVs2l/VW0VqlP6Y4w9O9j9yOFNdn3EIF8KRZdEMlSJjWyMUI ISf071S2LJN1L50HVz/lqEBJUFK2U1R6Of/lpq8xi8Gx+0m8mjZNA17iM6uCvl+4OTKB L+xvjngyK/NtoYUgl/K/QwZ9aMmbjhCvQo40BkydLdmNQokaiGKTIkwyeWZFyorE53NU jqAg== X-Forwarded-Encrypted: i=1; AJvYcCVoeJjnUaXRiMJiB14jBcX65eGlEac/68m/25494ypniQbmq3QjiXiuATYabcw3/vJqogFojzAZU0B8@lists.postgresql.org X-Gm-Message-State: AOJu0YzBd3762GluoW9jGHi1TeeS0ssWmIP85IJC4sWiOUrQH61xCQ12 qSIMFXYPVDFMcwTyHEBDMLUReYcivY4uH0Yh00HAYaHrKB56E53KS1f9 X-Gm-Gg: AZuq6aIzox2jCxrzMOK4zer6Lnkxqdif7alOOAofsT/W0ZweI6lPiC9bh0SvxcPmYgu /yy6QBDiFcDnG87XeqFhoiEsrfs9m4zqEh7A55Pet1j7zhRSft5rUCgVI0mDo0DW8Irh5mQrocO XGPf2STO817xNE++uG0t+A9TleQt0sa/T4n1JaZeG37+fCVN8SfLI2pF/bYoyhDQnFOB8VQUp10 HLR4oVzxpixK7BFNnlofUeUp5OmPCXehfNGh/1Li5LimIvCteIjG0xPBcQuvGgSu5vhiXzXkQmn ATpL6Wmx3Z7z3zg2i1O5MaUoatuXVBOS5euZ72vsEPWy3JWoIUFYI5c3OYNL93oZnluA7Wvnl/B w9o3s/b+O3gq/dnnLq4PybsHQ5jqsn/EMKiV4w/LBbxX7nXqRzeXyyDg1owH/HHoklFalY6GZ5Z Zjwi0bJTWxPqqnLzYNy0FIZThZuwXufKmMlochBnSuXSQ4YDQeu4bHpZaKyfcku5feFPX8OUacI HuFygustMcAW0FtNfYbsg== X-Received: by 2002:a05:6830:660b:b0:7cf:cb0b:dd10 with SMTP id 46e09a7af769-7d52bf812f7mr9361401a34.33.1771954459206; Tue, 24 Feb 2026 09:34:19 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7d52d0725dbsm10140904a34.29.2026.02.24.09.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 09:34:18 -0800 (PST) Date: Tue, 24 Feb 2026 11:34:16 -0600 From: Nathan Bossart To: Fujii Masao Cc: Sergei Kornilov , =?utf-8?B?0J7Qu9C10LMg0KHQsNC80L7QudC70L7Qsg==?= , pgsql-bugs@lists.postgresql.org, =?utf-8?Q?=C3=81lvaro?= Herrera Subject: Re: basic_archive lost archive_directory Message-ID: References: <202601301728.sfkizrto3t5i@alvherre.pgsql> <9b9341b0-942e-4d34-b94f-92bd918fad04@ya.ru> <1317421770387925@cea5cfd9-50d3-4d85-a924-a7cc75f8f215> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Feb 24, 2026 at 01:28:50PM +0900, Fujii Masao wrote: > I agree with removing the check from the GUC check hook. My only concern is > that simply removing it (rather than relocating it) changes the error message > users see when archive_directory is misconfigured, which may make > troubleshooting WAL archiving failures slightly harder. > > [Current] > WARNING: invalid value for parameter > "basic_archive.archive_directory": "not_exists" > DETAIL: Specified archive directory does not exist. > > [With the patch] > ERROR: could not create file > "not_exists/archtemp.00000001000000000000000E.80107.1771905339058": No > such file or directory > > One option would be to perform the check in check_configured_cb(), > but as you noted, that would add an extra stat() call for each WAL archiving. > If that overhead is unacceptable, another approach would be to wrap > copy_file() in basic_archive_file() with PG_TRY() / PG_CATCH(). On error, > we could stat() the archive directory and report a clearer reason if it does > not exist. > > That said, if users are generally fine with the "could not create file" error, > I'm ok with the proposed patch (i.e., just removing the check). I think it's fine as-is. If something is wrong with the error message, IMHO we should fix the error message. Adding extra stat() calls to try to give a nicer message might work most of the time, but there are still race conditions where users will see the original one. But in any case, I believe the current message style is used in many places, so I don't see a strong reason to do anything different here. -- nathan