Re: Add -k/--link option to pg_combinebackup - Mailing list pgsql-hackers

From vignesh C
Subject Re: Add -k/--link option to pg_combinebackup
Date
Msg-id CALDaNm3HpBgqRSh_pWTF9NHiPG7+bBF6TO6sN+TcZZdrRFG8rg@mail.gmail.com
Whole thread Raw
In response to Re: Add -k/--link option to pg_combinebackup  (Israel Barth Rubio <barthisrael@gmail.com>)
Responses Re: Add -k/--link option to pg_combinebackup
List pgsql-hackers
On Fri, 21 Feb 2025 at 03:50, Israel Barth Rubio <barthisrael@gmail.com> wrote:
>
> There are some failures on compiler warnings and Windows jobs that
> seem unrelated with this patch.
>
> Besides that, there were failures when executing `010_links.pl` in the
> Linux autoconf jobs. As discussed in a side chat with Euler and Robert,
> and pointed out by Robert, Cirrus CI uses a very small
> `--with-segsize-blocks`. My tests in the V2 patch were assuming 1GB
> segments, so they were failing in Cirrus CI.
>
> The patch V3, which I'm attaching in this reply, implements some logic
> to handle any segment size.

Few comments:
1) The new file 010_links.pl added should be included to meson.build also:
    'tests': [
      't/010_pg_basebackup.pl',
      't/011_in_place_tablespace.pl',
      't/020_pg_receivewal.pl',
      't/030_pg_recvlogical.pl',
      't/040_pg_createsubscriber.pl',
    ],

2) Since it is a new file, "Copyright (c) 2021-2025" should be
"Copyright (c) 2025":
+++ b/src/bin/pg_combinebackup/t/010_links.pl
@@ -0,0 +1,212 @@
+# Copyright (c) 2021-2025, PostgreSQL Global Development Group
+#
+# This test aims to validate that hard links are created as expected in the
+# output directory, when running pg_combinebackup with --link mode.

3) Since it is a single statement, no need of braces here:
+       /* Warn about the possibility of compromising the backups,
when link mode */
+       if (opt.copy_method == COPY_METHOD_LINK)
+       {
+               pg_log_warning("--link mode was used; any
modifications to the output "
+                                          "directory may
destructively modify input directories");
+       }

Regards,
Vignesh



pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: suspicious lockup on widowbird in AdvanceXLInsertBuffer (could it be due to 6a2275b8953?)
Next
From: Rushabh Lathia
Date:
Subject: Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints