public inbox for [email protected]  
help / color / mirror / Atom feed
remove obsolete comment in AtEOXact_Inval
4+ messages / 3 participants
[nested] [flat]

* remove obsolete comment in AtEOXact_Inval
@ 2025-10-27 02:43 Steven Niu <[email protected]>
  2025-10-27 03:50 ` Re: remove obsolete comment in AtEOXact_Inval Chao Li <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Steven Niu @ 2025-10-27 02:43 UTC (permalink / raw)
  To: pgsql-hackers

Hi, Hackers,

When I read the code, I noticed there is one line of comment in function AtEOXact_Inval() which is obviously obsolete.

    "This should be called as the last step in processing a transaction"

AtEOXact_Inval() is called in CommitTransaction() and AbortTransaction() and there are many other steps after function AtEOXact_Inval() is called.
Such as:
      AtCommit_Notify();
      AtEOXact_GUC(true, 1);
      AtEOXact_SPI(true);
      AtEOXact_Enum();
      AtEOXact_on_commit_actions(true);
      AtEOXact_Namespace(true, is_parallel_worker);
      AtEOXact_SMgr();
      AtEOXact_Files(true);
      AtEOXact_ComboCid();
      AtEOXact_HashTables(true);
      AtEOXact_PgStat(true, is_parallel_worker);
      AtEOXact_Snapshot(true, false);
      AtEOXact_ApplyLauncher(true);
      AtEOXact_LogicalRepWorkers(true);

So that comment is no longer true. I made a patch to remove it as attached.

Best Regards,
Steven


Attachments:

  [application/octet-stream] 0001-PATCH-remove-obsolete-comment-in-AtEOXact_Inval.patch (1.1K, 3-0001-PATCH-remove-obsolete-comment-in-AtEOXact_Inval.patch)
  download | inline diff:
From c8c79a425b0db0407bddaafac61ab0475d442bf3 Mon Sep 17 00:00:00 2001
From: Steven Niu <[email protected]>
Date: Mon, 27 Oct 2025 10:18:56 +0800
Subject: [PATCH] remove obsolete comment in AtEOXact_Inval

There are many other steps after function AtEOXact_Inval() is called
in processing a transaction. So the comment of function AtEOXact_Inval()
"This should be called as the last step in processing a transaction."
is obsolete and should be deleted.

Author: Steven Niu <[email protected]>
---
 src/backend/utils/cache/inval.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c
index 02505c88b8e..e6a93229e6f 100644
--- a/src/backend/utils/cache/inval.c
+++ b/src/backend/utils/cache/inval.c
@@ -1191,9 +1191,6 @@ ProcessCommittedInvalidationMessages(SharedInvalidationMessage *msgs,
  * In any case, reset our state to empty.  We need not physically
  * free memory here, since TopTransactionContext is about to be emptied
  * anyway.
- *
- * Note:
- *		This should be called as the last step in processing a transaction.
  */
 void
 AtEOXact_Inval(bool isCommit)
-- 
2.43.0



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: remove obsolete comment in AtEOXact_Inval
  2025-10-27 02:43 remove obsolete comment in AtEOXact_Inval Steven Niu <[email protected]>
@ 2025-10-27 03:50 ` Chao Li <[email protected]>
  2026-05-08 08:54   ` Re: remove obsolete comment in AtEOXact_Inval Daniel Gustafsson <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Chao Li @ 2025-10-27 03:50 UTC (permalink / raw)
  To: Steven Niu <[email protected]>; +Cc: pgsql-hackers



> On Oct 27, 2025, at 10:43, Steven Niu <[email protected]> wrote:
> 
> Hi, Hackers,
> 
> When I read the code, I noticed there is one line of comment in function AtEOXact_Inval() which is obviously obsolete.
> 
>     "This should be called as the last step in processing a transaction"  
> 
> Steven<0001-PATCH-remove-obsolete-comment-in-AtEOXact_Inval.patch>

+1

The comment of "void AtEOXact_Inval(bool isCommit):
```
 * Note:
* This should be called as the last step in processing a transaction.
```
Was added 29 years ago.

However, looking at CommitTransaction():

```
    /*
* Make catalog changes visible to all backends. This has to happen after
* relcache references are dropped (see comments for
* AtEOXact_RelationCache), but before locks are released (if anyone is
* waiting for lock on a relation we've modified, we want them to know
* about the catalog change before they start using the relation).
*/
AtEOXact_Inval(true);

AtEOXact_MultiXact(); # <=== added 21 years ago
```

it seems the newer change has made the original comment inaccurate.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/









^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: remove obsolete comment in AtEOXact_Inval
  2025-10-27 02:43 remove obsolete comment in AtEOXact_Inval Steven Niu <[email protected]>
  2025-10-27 03:50 ` Re: remove obsolete comment in AtEOXact_Inval Chao Li <[email protected]>
@ 2026-05-08 08:54   ` Daniel Gustafsson <[email protected]>
  2026-05-18 15:50     ` Re: remove obsolete comment in AtEOXact_Inval Daniel Gustafsson <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Daniel Gustafsson @ 2026-05-08 08:54 UTC (permalink / raw)
  To: Chao Li <[email protected]>; +Cc: Steven Niu <[email protected]>; pgsql-hackers

> On 27 Oct 2025, at 04:50, Chao Li <[email protected]> wrote:
> 
>> On Oct 27, 2025, at 10:43, Steven Niu <[email protected]> wrote:
>> 
>> Hi, Hackers,
>> 
>> When I read the code, I noticed there is one line of comment in function AtEOXact_Inval() which is obviously obsolete.
>> 
>>    "This should be called as the last step in processing a transaction"  
>> 
>> Steven<0001-PATCH-remove-obsolete-comment-in-AtEOXact_Inval.patch>
> 
> +1
> 
> The comment of "void AtEOXact_Inval(bool isCommit):
> ```
> * Note:
> * This should be called as the last step in processing a transaction.
> ```
> Was added 29 years ago.

This comment was part of the Postgres95 import, and was originally added to the
function RegisterInvalid() which in turn was committed by Cimarron Taylor in
1990.  I agree that it's no longer helpful and will go ahead to remove it shortly
unless someone disagrees.

--
Daniel Gustafsson







^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: remove obsolete comment in AtEOXact_Inval
  2025-10-27 02:43 remove obsolete comment in AtEOXact_Inval Steven Niu <[email protected]>
  2025-10-27 03:50 ` Re: remove obsolete comment in AtEOXact_Inval Chao Li <[email protected]>
  2026-05-08 08:54   ` Re: remove obsolete comment in AtEOXact_Inval Daniel Gustafsson <[email protected]>
@ 2026-05-18 15:50     ` Daniel Gustafsson <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Daniel Gustafsson @ 2026-05-18 15:50 UTC (permalink / raw)
  To: Chao Li <[email protected]>; +Cc: Steven Niu <[email protected]>; pgsql-hackers

> On 8 May 2026, at 01:54, Daniel Gustafsson <[email protected]> wrote:

> This comment was part of the Postgres95 import, and was originally added to the
> function RegisterInvalid() which in turn was committed by Cimarron Taylor in
> 1990.  I agree that it's no longer helpful and will go ahead to remove it shortly
> unless someone disagrees.

Done.

--
Daniel Gustafsson







^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2026-05-18 15:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-10-27 02:43 remove obsolete comment in AtEOXact_Inval Steven Niu <[email protected]>
2025-10-27 03:50 ` Chao Li <[email protected]>
2026-05-08 08:54   ` Daniel Gustafsson <[email protected]>
2026-05-18 15:50     ` Daniel Gustafsson <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox