Checking MINIMUM_VERSION_FOR_WAL_SUMMARIES

From: Artur Zakirov <zaartur(at)gmail(dot)com>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Checking MINIMUM_VERSION_FOR_WAL_SUMMARIES
Date: 2024-02-02 00:11:27
Message-ID: CAKNkYnzkkQ0gb_ZmLTY0r2-qV1q6imXgcCWxdA6UoA6yJkujGg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

--
Artur

Attachment Content-Type Size
v1-0001-Fix-checking-MINIMUM_VERSION_FOR_WAL_SUMMARIES.patch text/x-patch 925 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Morris 2024-02-02 00:19:30 Re: Where can I find the doxyfile?
Previous Message David G. Johnston 2024-02-01 22:47:15 [Doc] Improve hostssl related descriptions and option presentation