pg_combinebackup: correct code comment.

Started by Amul Sul9 months ago5 messages
#1Amul Sul
sulamul@gmail.com
1 attachment(s)

Hi,
Cc: Robert

Attached is a patch that corrects the code comment for
process_directory_recursively() in pg_combinebackup, where the comment
incorrectly refers to "output_directory" instead of the intended
"input_directory".

--
Regards,
Amul Sul
EDB: http://www.enterprisedb.com

Attachments:

0001-pg_combinebackup-Fix-incorrect-code-comment.patchapplication/x-patch; name=0001-pg_combinebackup-Fix-incorrect-code-comment.patchDownload
From 80765206dcdc5e474cf49b92846a57b61c50e006 Mon Sep 17 00:00:00 2001
From: Amul Sul <sulamul@gmail.com>
Date: Tue, 15 Apr 2025 09:42:52 +0530
Subject: [PATCH] pg_combinebackup: Fix incorrect code comment.

The comment in the process_directory_recursively() prologue
incorrectly refers to output_directory instead of input_directory.
---
 src/bin/pg_combinebackup/pg_combinebackup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/pg_combinebackup/pg_combinebackup.c b/src/bin/pg_combinebackup/pg_combinebackup.c
index 4f8ba156336..7544c6b33ee 100644
--- a/src/bin/pg_combinebackup/pg_combinebackup.c
+++ b/src/bin/pg_combinebackup/pg_combinebackup.c
@@ -826,7 +826,7 @@ parse_oid(char *s, Oid *result)
  *
  * n_prior_backups is the number of prior backups that we have available.
  * This doesn't count the very last backup, which is referenced by
- * output_directory, just the older ones. prior_backup_dirs is an array of
+ * input_directory, just the older ones. prior_backup_dirs is an array of
  * the locations of those previous backups.
  */
 static void
-- 
2.43.5

#2Daniel Gustafsson
daniel@yesql.se
In reply to: Amul Sul (#1)
Re: pg_combinebackup: correct code comment.

On 15 Apr 2025, at 06:22, Amul Sul <sulamul@gmail.com> wrote:

Attached is a patch that corrects the code comment for
process_directory_recursively() in pg_combinebackup, where the comment
incorrectly refers to "output_directory" instead of the intended
"input_directory".

Agreed. The second paragraph in the comment also seem a bit odd, how about the
below while we are there fixing things?

- * If processing is a user-defined tablespace, the tsoid should be the OID
+ * If processing a user-defined tablespace, the tsoid should be the OID

--
Daniel Gustafsson

#3Amul Sul
sulamul@gmail.com
In reply to: Daniel Gustafsson (#2)
Re: pg_combinebackup: correct code comment.

On Tue, Apr 15, 2025 at 1:16 PM Daniel Gustafsson <daniel@yesql.se> wrote:

On 15 Apr 2025, at 06:22, Amul Sul <sulamul@gmail.com> wrote:

Attached is a patch that corrects the code comment for
process_directory_recursively() in pg_combinebackup, where the comment
incorrectly refers to "output_directory" instead of the intended
"input_directory".

Agreed. The second paragraph in the comment also seem a bit odd, how about the
below while we are there fixing things?

- * If processing is a user-defined tablespace, the tsoid should be the OID
+ * If processing a user-defined tablespace, the tsoid should be the OID

+1

Regards,
Amul

#4Robert Haas
robertmhaas@gmail.com
In reply to: Daniel Gustafsson (#2)
Re: pg_combinebackup: correct code comment.

On Tue, Apr 15, 2025 at 3:46 AM Daniel Gustafsson <daniel@yesql.se> wrote:

On 15 Apr 2025, at 06:22, Amul Sul <sulamul@gmail.com> wrote:
Attached is a patch that corrects the code comment for
process_directory_recursively() in pg_combinebackup, where the comment
incorrectly refers to "output_directory" instead of the intended
"input_directory".

Agreed. The second paragraph in the comment also seem a bit odd, how about the
below while we are there fixing things?

- * If processing is a user-defined tablespace, the tsoid should be the OID
+ * If processing a user-defined tablespace, the tsoid should be the OID

Yeah, I agree with both of these changes. Feel free to commit, unless
you want me to do it.

--
Robert Haas
EDB: http://www.enterprisedb.com

#5Daniel Gustafsson
daniel@yesql.se
In reply to: Robert Haas (#4)
Re: pg_combinebackup: correct code comment.

On 15 Apr 2025, at 14:41, Robert Haas <robertmhaas@gmail.com> wrote:

On Tue, Apr 15, 2025 at 3:46 AM Daniel Gustafsson <daniel@yesql.se> wrote:

On 15 Apr 2025, at 06:22, Amul Sul <sulamul@gmail.com> wrote:
Attached is a patch that corrects the code comment for
process_directory_recursively() in pg_combinebackup, where the comment
incorrectly refers to "output_directory" instead of the intended
"input_directory".

Agreed. The second paragraph in the comment also seem a bit odd, how about the
below while we are there fixing things?

- * If processing is a user-defined tablespace, the tsoid should be the OID
+ * If processing a user-defined tablespace, the tsoid should be the OID

Yeah, I agree with both of these changes. Feel free to commit, unless
you want me to do it.

No worries, I had this staged anyways from looking at Amul's patch so done as
7ae13170ba5 with a backpatch to 17 as it was a documentation fix and not just a
typo fix.

--
Daniel Gustafsson