Re: remove obsolete comment in AtEOXact_Inval

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Steven Niu <niushiji(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: remove obsolete comment in AtEOXact_Inval
Date: 2025-10-27 03:50:21
Message-ID: 9ED67E9F-9735-4033-AF27-31A674DE75C8@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Oct 27, 2025, at 10:43, Steven Niu <niushiji(at)gmail(dot)com> 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/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2025-10-27 03:50:33 Re: Enhance statistics reset functions to return reset timestamp
Previous Message Shinya Kato 2025-10-27 03:36:15 Re: Enhance statistics reset functions to return reset timestamp