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 1vqHXR-007xRg-2D for pgsql-bugs@arkaria.postgresql.org; Wed, 11 Feb 2026 21:14:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vqHXQ-005zy0-20 for pgsql-bugs@arkaria.postgresql.org; Wed, 11 Feb 2026 21:14:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vqHXQ-005zxq-1A for pgsql-bugs@lists.postgresql.org; Wed, 11 Feb 2026 21:14:21 +0000 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vqHXP-00000000DHL-0nGk for pgsql-bugs@lists.postgresql.org; Wed, 11 Feb 2026 21:14:20 +0000 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-45f015a3259so2140261b6e.2 for ; Wed, 11 Feb 2026 13:14:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770844457; x=1771449257; 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=lTW801QBEDKRN/AIfT0w4SMyB0RzxcKElN94ZqomSLc=; b=kMyIN7jWk7WEEMOmUSubOFptHSN3qlUhFm7b3wVsC7mfkUR454EdvNhhQN6197SSs2 3eDfVDxVVs3gpoNGJdfuxYvyakBACl49o5kl5fCGpP1RZMJrO5MtVrkyCrKBnComF4tQ e7SIsPWFyGQQeYKRqmG6hVYYWRq73rjLhPceSegsyRpgmFZOALX2N+8SQJG0/IJJvhN6 k8Nr90RdAB6cyMuK8Fo/BoEk1lL8xVZ0Pt8cYMwVbcq3a6VP1RIZxUZ0vDbpQ7Ree3a4 0PIeeoOtJi3YwZFypaV5/UOUEbP8pFbMgz/TjhsvCmOCoAAAhRvW4gd2G8Ep/ED1KM6I WDaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770844457; x=1771449257; 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=lTW801QBEDKRN/AIfT0w4SMyB0RzxcKElN94ZqomSLc=; b=H8W/QRGP2W8Y4LFykgyN3sYF16KQrtT9K/qFbLRv2bHuUeepbXtYuFvd5bmCpehchx 3WJ+XvkrY+AVJfe/p+XmJWapMllu1XpyDQBypj/CM9w8VWBANYCUZAGRnA2PGsHf35Z4 HYtUZvy3Kd6y73jBMIrY84uK2ly7F79SZ8E9Yo2714st3oVR4jjTdT2bjUtykxMV7Xcz kyZCdoeQrwfQHylKlSBhnWMBB/PF3GgPbOciVI8Zr2UDaxAtw+I1l2RVDFCBr4H3F8nm ympACFsR58My7F/EXmCIhXX+RQEGcUcYL0Eu3Z0mun5KBJyxRTJ0igyhxikajx+hjFTr 6G0w== X-Forwarded-Encrypted: i=1; AJvYcCUd2K6Ka0eQ8FaYpnk483MUBtSr9z+WzXo253CeN5CeMV+GdJ3xLuU2tg9aSjW6QSzLMsPBY73U46Nt@lists.postgresql.org X-Gm-Message-State: AOJu0Yyes4i+aaAmCfYN5Nf+dqBFOkULDALFNTgQsWef334++THBFK8f +APGUir4lX5hQ46DvKAnJcmP2TrMh9Gf6o6OTBYdtiX6g8Itnq24RC8t X-Gm-Gg: AZuq6aIKYdFYONBxdzpyYZQvw8IBJBtGYQTA6zY4uoDYtq6JAjA6vwNeiowL68kJXSJ CgEIe4S5QInJtK5V8Gb1XwV+Jzzj81g8Aw1f/LaKVenwNxkYGur/poN+Nx5ppBeYS19NvGPEknq xL5BJXWgDZBIRKl4ltdMNIk6QxFpI5w1Sx6zD7ZFciVL+/G5xFdseq36Lj2EJdIjgUE7dDHFL+5 bS7e66s1VvSCeJkoac2sw4B2r8+ar/kowLM4MWYRbDYn8+CoMq7i/1IQvkLGi9xJZwfFO3AIqKQ OPbLPLXGV1Et9PUTGR/SrlmaxCQKn587JuOtfjE/u3+0rv2WcE1Pf5lxEzu+WFNJUO9hYs7mg1I yCvEEmC2K+QvlD98MqWArUOkMhOmkIAHdBfYgk8Oo/q+lxtBZQVym7IoLGcG1mNmGhW8J6rx5p4 0SuBZDK9PxKgitt6ZQUqMyv41eKLxSQojym7tUkuon0t+ysDNbinxPNvgQpMhp+GKjwVtHSAjfS vw6GaiSb37PPepA3AThz/zvt28= X-Received: by 2002:a05:6808:3020:b0:45c:9453:474f with SMTP id 5614622812f47-4637b8c0660mr402794b6e.55.1770844457518; Wed, 11 Feb 2026 13:14:17 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 5614622812f47-4636b0cf66dsm1522659b6e.19.2026.02.11.13.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Feb 2026 13:14:16 -0800 (PST) Date: Wed, 11 Feb 2026 15:14:15 -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: multipart/mixed; boundary="pz+mDfPuC3M6Tm7Q" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --pz+mDfPuC3M6Tm7Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Feb 10, 2026 at 10:06:25AM -0600, Nathan Bossart wrote: > As I mentioned upthread, IMHO we should simply remove the existence check > from the GUC check hook. basic_archive must already be written to handle > the archive directory disappearing at any moment, so we should be able to > rely on it without the extra stat(). Concretely, like the attached. -- nathan --pz+mDfPuC3M6Tm7Q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v1-0001-basic_archive-Allow-archive-directory-to-be-missi.patch From e89acb5ad9c37d79374f9b1084b594c9c8e47a0a Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Wed, 11 Feb 2026 15:10:27 -0600 Subject: [PATCH v1 1/1] basic_archive: Allow archive directory to be missing at startup. --- contrib/basic_archive/basic_archive.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/contrib/basic_archive/basic_archive.c b/contrib/basic_archive/basic_archive.c index 6c7f985d48b..8c7e9be624f 100644 --- a/contrib/basic_archive/basic_archive.c +++ b/contrib/basic_archive/basic_archive.c @@ -90,13 +90,11 @@ _PG_archive_module_init(void) /* * check_archive_directory * - * Checks that the provided archive directory exists. + * Checks that the provided archive directory path isn't too long. */ static bool check_archive_directory(char **newval, void **extra, GucSource source) { - struct stat st; - /* * The default value is an empty string, so we have to accept that value. * Our check_configured callback also checks for this and prevents @@ -115,17 +113,6 @@ check_archive_directory(char **newval, void **extra, GucSource source) return false; } - /* - * Do a basic sanity check that the specified archive directory exists. It - * could be removed at some point in the future, so we still need to be - * prepared for it not to exist in the actual archiving logic. - */ - if (stat(*newval, &st) != 0 || !S_ISDIR(st.st_mode)) - { - GUC_check_errdetail("Specified archive directory does not exist."); - return false; - } - return true; } -- 2.50.1 (Apple Git-155) --pz+mDfPuC3M6Tm7Q--