Fix a typo of comments in AutoVacLauncherMain

Started by Yugo Nagata5 months ago3 messages
#1Yugo Nagata
nagata@sraoss.co.jp
1 attachment(s)

Hi,

While reading autovacuum.c, I found the following comments in
AutoVacLauncherMain() right before the call to rebuild_database_list();

* Create the initial database list. The invariant we want this list to
* keep is that it's ordered by decreasing next_time. As soon as an entry

However, I couldn't fnd any variable named "next_time". I believe it actually refers
to adl_next_worker and the comments should use "next_worker" as is done in other nereby
comments. I've attahed a patch to address this.

Regards,
Yugo Nagata

--
Yugo Nagata <nagata@sraoss.co.jp>

Attachments:

fix_comment_typo_autovacuum.patchtext/x-diff; name=fix_comment_typo_autovacuum.patchDownload
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 9474095f271..5161ec39d72 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -562,7 +562,7 @@ AutoVacLauncherMain(const void *startup_data, size_t startup_data_len)
 
 	/*
 	 * Create the initial database list.  The invariant we want this list to
-	 * keep is that it's ordered by decreasing next_time.  As soon as an entry
+	 * keep is that it's ordered by decreasing next_worker.  As soon as an entry
 	 * is updated to a higher time, it will be moved to the front (which is
 	 * correct because the only operation is to add autovacuum_naptime to the
 	 * entry, and time always increases).
#2Masahiko Sawada
sawada.mshk@gmail.com
In reply to: Yugo Nagata (#1)
Re: Fix a typo of comments in AutoVacLauncherMain

On Fri, Aug 1, 2025 at 8:20 AM Yugo Nagata <nagata@sraoss.co.jp> wrote:

Hi,

While reading autovacuum.c, I found the following comments in
AutoVacLauncherMain() right before the call to rebuild_database_list();

* Create the initial database list. The invariant we want this list to
* keep is that it's ordered by decreasing next_time. As soon as an entry

However, I couldn't fnd any variable named "next_time". I believe it actually refers
to adl_next_worker and the comments should use "next_worker" as is done in other nereby
comments. I've attahed a patch to address this.

I agree with your analysis. WIll push the patch shortly, barring any objections.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

#3Yugo Nagata
nagata@sraoss.co.jp
In reply to: Masahiko Sawada (#2)
Re: Fix a typo of comments in AutoVacLauncherMain

On Fri, 1 Aug 2025 10:00:48 -0700
Masahiko Sawada <sawada.mshk@gmail.com> wrote:

On Fri, Aug 1, 2025 at 8:20 AM Yugo Nagata <nagata@sraoss.co.jp> wrote:

Hi,

While reading autovacuum.c, I found the following comments in
AutoVacLauncherMain() right before the call to rebuild_database_list();

* Create the initial database list. The invariant we want this list to
* keep is that it's ordered by decreasing next_time. As soon as an entry

However, I couldn't fnd any variable named "next_time". I believe it actually refers
to adl_next_worker and the comments should use "next_worker" as is done in other nereby
comments. I've attahed a patch to address this.

I agree with your analysis. WIll push the patch shortly, barring any objections.

Thank you!

Yugo Nagata
Regards,

--
Yugo Nagata <nagata@sraoss.co.jp>