Thread: pgsql: Update high level vacuumlazy.c comments.

pgsql: Update high level vacuumlazy.c comments.

From
Peter Geoghegan
Date:
Update high level vacuumlazy.c comments.

Update vacuumlazy.c file header comments (as well as comments above the
lazy_scan_heap function) that were largely written before the
introduction of the HOT optimization, when lazy_scan_heap did far less,
and didn't actually prune during its initial heap pass.

Since lazy_scan_heap now outsources far more work to lower level
functions, it makes sense to introduce the function by talking about the
high level invariant that dictates the order in which each phase takes
place.  Also deemphasize the case where we run out of memory for TIDs,
since delaying that discussion makes it easier to talk about issues of
central importance.

Finally, remove discussion of parallel VACUUM from header comments.
These don't add much, and are in the wrong place.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/12b5ade9023f3ecaddcbc423a22dc284c91c79f6

Modified Files
--------------
src/backend/access/heap/vacuumlazy.c | 138 ++++++++++++++++++-----------------
1 file changed, 70 insertions(+), 68 deletions(-)


Re: pgsql: Update high level vacuumlazy.c comments.

From
Robert Haas
Date:
On Sat, Nov 27, 2021 at 5:31 PM Peter Geoghegan <pg@bowt.ie> wrote:
> Update high level vacuumlazy.c comments.
>
> Update vacuumlazy.c file header comments (as well as comments above the
> lazy_scan_heap function) that were largely written before the
> introduction of the HOT optimization, when lazy_scan_heap did far less,
> and didn't actually prune during its initial heap pass.
>
> Since lazy_scan_heap now outsources far more work to lower level
> functions, it makes sense to introduce the function by talking about the
> high level invariant that dictates the order in which each phase takes
> place.  Also deemphasize the case where we run out of memory for TIDs,
> since delaying that discussion makes it easier to talk about issues of
> central importance.
>
> Finally, remove discussion of parallel VACUUM from header comments.
> These don't add much, and are in the wrong place.
>
> Branch
> ------
> master
>
> Details
> -------
> https://git.postgresql.org/pg/commitdiff/12b5ade9023f3ecaddcbc423a22dc284c91c79f6

I don't know whether this was discussed and you forgot to include a
Discussion link, or whether it wasn't discussed on list, but typically
both things should happen.

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



Re: pgsql: Update high level vacuumlazy.c comments.

From
Peter Geoghegan
Date:
On Mon, Nov 29, 2021 at 6:58 AM Robert Haas <robertmhaas@gmail.com> wrote:
> I don't know whether this was discussed and you forgot to include a
> Discussion link, or whether it wasn't discussed on list, but typically
> both things should happen.

This was a piece of the patch I posted here, which was discussed in
general terms:

https://postgr.es/m/CAH2-WzktGBg4si6DEdmq3q6SoXSDqNi6MtmB8CmmTmvhsxDTLA@mail.gmail.com

I found it useful to spin off the parts that reworked the high level
comments, which aren't really related to the main point of discussion
in the thread. I think that I didn't supply a link for that reason.

--
Peter Geoghegan



Re: pgsql: Update high level vacuumlazy.c comments.

From
Alvaro Herrera
Date:
On 2021-Nov-29, Peter Geoghegan wrote:

> This was a piece of the patch I posted here, which was discussed in
> general terms:
> 
> https://postgr.es/m/CAH2-WzktGBg4si6DEdmq3q6SoXSDqNi6MtmB8CmmTmvhsxDTLA@mail.gmail.com
> 
> I found it useful to spin off the parts that reworked the high level
> comments, which aren't really related to the main point of discussion
> in the thread. I think that I didn't supply a link for that reason.

I think the only reason not to include a discussion link in the commit
message is that the patch is so trivial that there *is* no related post
in the mailing list.

-- 
Álvaro Herrera              Valdivia, Chile  —  https://www.EnterpriseDB.com/
 Are you not unsure you want to delete Firefox?
       [Not unsure]     [Not not unsure]    [Cancel]
                   http://smylers.hates-software.com/2008/01/03/566e45b2.html



Re: pgsql: Update high level vacuumlazy.c comments.

From
Robert Haas
Date:
On Tue, Nov 30, 2021 at 9:41 AM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> I think the only reason not to include a discussion link in the commit
> message is that the patch is so trivial that there *is* no related post
> in the mailing list.

+1. And that shouldn't happen often.

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



Re: pgsql: Update high level vacuumlazy.c comments.

From
Peter Geoghegan
Date:
On Tue, Nov 30, 2021 at 12:20 PM Robert Haas <robertmhaas@gmail.com> wrote:
> +1. And that shouldn't happen often.

Why shouldn't it happen often?

I accept that I ought to have included a discussion link in this
instance. But I don't see how that's related to how often I commit
things where including a discussion link is unnecessary (per the
general convention for these things).

-- 
Peter Geoghegan



Re: pgsql: Update high level vacuumlazy.c comments.

From
Robert Haas
Date:
On Tue, Nov 30, 2021 at 3:45 PM Peter Geoghegan <pg@bowt.ie> wrote:
> On Tue, Nov 30, 2021 at 12:20 PM Robert Haas <robertmhaas@gmail.com> wrote:
> > +1. And that shouldn't happen often.
>
> Why shouldn't it happen often?
>
> I accept that I ought to have included a discussion link in this
> instance. But I don't see how that's related to how often I commit
> things where including a discussion link is unnecessary (per the
> general convention for these things).

Because there aren't many things that are so mechanical that there's
no reason to give people an opportunity to comment. Sure, if you're
just changing "teh" to "the" that's boring and there's nothing to talk
about. But if you're doing that every day, you should consolidate your
typo fix patches a bit so we don't clutter the commit history. If
you're making changes that people might disagree with, it's polite to
give them an opportunity to object before you commit. Even if most of
the time they don't.

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