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 1rVp7e-001XBl-Ok for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Feb 2024 08:42:07 +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 1rVp7d-00BVLj-Vf for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Feb 2024 08:42:05 +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 1rVp7d-00BVLZ-Ma for pgsql-hackers@lists.postgresql.org; Fri, 02 Feb 2024 08:42:05 +0000 Received: from ml.sraoss.co.jp ([66.11.59.17]) by makus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rVp7X-004fZ4-65 for pgsql-hackers@lists.postgresql.org; Fri, 02 Feb 2024 08:42:04 +0000 Received: from sranhm.sraoss.co.jp (unknown [192.168.174.164]) by osspc26.sraoss.co.jp (Postfix) with ESMTP id B8B852F0008C; Fri, 2 Feb 2024 17:41:56 +0900 (JST) Received: from yugon-CFSV7-1 (unknown [192.168.176.19]) by sranhm.sraoss.co.jp (Postfix) with SMTP id A446B341779; Fri, 2 Feb 2024 17:41:56 +0900 (JST) Date: Fri, 2 Feb 2024 17:41:56 +0900 From: Yugo NAGATA To: Artur Zakirov Cc: Postgres hackers Subject: Re: Checking MINIMUM_VERSION_FOR_WAL_SUMMARIES Message-Id: <20240202174156.0272031c68033037abfe4fdf@sraoss.co.jp> In-Reply-To: References: X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2 Feb 2024 01:11:27 +0100 Artur Zakirov wrote: > Hi hackers, > > during reading the source code of new incremental backup functionality > I noticed that the following condition can by unintentional: > > /* > * For newer server versions, likewise create pg_wal/summaries > */ > if (PQserverVersion(conn) < MINIMUM_VERSION_FOR_WAL_SUMMARIES) > { > ... > > if (pg_mkdir_p(summarydir, pg_dir_create_mode) != 0 && > errno != EEXIST) > pg_fatal("could not create directory \"%s\": %m", summarydir); > } > > This is from src/bin/pg_basebackup/pg_basebackup.c. > > Is the condition correct? Shouldn't it be ">=". Otherwise the function > will create "/summaries" only for older PostgreSQL versions. > > I've attached a patch to fix it in case this is a typo. I also think it should be ">=" Also, if so, I don't think the check of MINIMUM_VERSION_FOR_PG_WAL in the block is required, because the directory name is always pg_wal in the new versions. Regards, Yugo Nagata > > -- > Artur -- Yugo NAGATA