out of date comment in commit_ts.c

Started by Nathan Bossartover 3 years ago4 messages
#1Nathan Bossart
nathandbossart@gmail.com

Hi hackers,

I noticed that commit_ts.c has the following comment:

* XLOG interactions: this module generates an XLOG record whenever a new
* CommitTs page is initialized to zeroes. Also, one XLOG record is
* generated for setting of values when the caller requests it; this allows
* us to support values coming from places other than transaction commit.
* Other writes of CommitTS come from recording of transaction commit in
* xact.c, which generates its own XLOG records for these events and will
* re-perform the status update on redo; so we need make no additional XLOG
* entry here.

IIUC the ability for callers to request WAL record generation is no longer
possible as of 08aa89b [0]https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=08aa89b. Should the second sentence be removed?

[0]: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=08aa89b

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

#2Nathan Bossart
nathandbossart@gmail.com
In reply to: Nathan Bossart (#1)
1 attachment(s)
Re: out of date comment in commit_ts.c

On Tue, Jul 26, 2022 at 10:33:43AM -0700, Nathan Bossart wrote:

IIUC the ability for callers to request WAL record generation is no longer
possible as of 08aa89b [0]. Should the second sentence be removed?

Here's a patch.

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

Attachments:

fix_commit_ts_comment.patchtext/x-diff; charset=us-asciiDownload
diff --git a/src/backend/access/transam/commit_ts.c b/src/backend/access/transam/commit_ts.c
index 4dc8d402bd..9aa4675cb7 100644
--- a/src/backend/access/transam/commit_ts.c
+++ b/src/backend/access/transam/commit_ts.c
@@ -7,13 +7,10 @@
  * for each transaction.
  *
  * XLOG interactions: this module generates an XLOG record whenever a new
- * CommitTs page is initialized to zeroes.  Also, one XLOG record is
- * generated for setting of values when the caller requests it; this allows
- * us to support values coming from places other than transaction commit.
- * Other writes of CommitTS come from recording of transaction commit in
- * xact.c, which generates its own XLOG records for these events and will
- * re-perform the status update on redo; so we need make no additional XLOG
- * entry here.
+ * CommitTs page is initialized to zeroes.  Other writes of CommitTS come
+ * from recording of transaction commit in xact.c, which generates its own
+ * XLOG records for these events and will re-perform the status update on
+ * redo; so we need make no additional XLOG entry here.
  *
  * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
#3Thomas Munro
thomas.munro@gmail.com
In reply to: Nathan Bossart (#2)
Re: out of date comment in commit_ts.c

On Thu, Jul 28, 2022 at 8:30 AM Nathan Bossart <nathandbossart@gmail.com> wrote:

On Tue, Jul 26, 2022 at 10:33:43AM -0700, Nathan Bossart wrote:

IIUC the ability for callers to request WAL record generation is no longer
possible as of 08aa89b [0]. Should the second sentence be removed?

Here's a patch.

Pushed.

#4Nathan Bossart
nathandbossart@gmail.com
In reply to: Thomas Munro (#3)
Re: out of date comment in commit_ts.c

On Tue, Aug 09, 2022 at 01:02:15PM +1200, Thomas Munro wrote:

Pushed.

Thanks!

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com