Re: parallel vacuum comments

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: parallel vacuum comments
Date: 2021-11-24 02:18:07
Message-ID: CAD21AoBMfF-L+xtBRdj4mSaGv8P=RakHY8izvPj4LwNdBjWP_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 19, 2021 at 11:25 AM houzj(dot)fnst(at)fujitsu(dot)com
<houzj(dot)fnst(at)fujitsu(dot)com> wrote:
>
> On Tues, Nov 16, 2021 1:53 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> > I've incorporated these comments and attached an updated patch.
>
> Thanks for updating the patch.
> I read the latest patch and have few comments.

Thank you for the comments! For the comments (2) and (4), I replied in
a separate email to answer your and Amit's comments.

>
> 1)
> +/*
> + * lazy_vacuum_one_index() -- vacuum index relation.
> ...
> +IndexBulkDeleteResult *
> +vacuum_one_index(IndexVacuumInfo *ivinfo, IndexBulkDeleteResult *istat,
>
>
> + * vac_cleanup_one_index() -- do post-vacuum cleanup for index relation.
> ...
> +IndexBulkDeleteResult *
> +cleanup_one_index(IndexVacuumInfo *ivinfo, IndexBulkDeleteResult *istat)
>
> The above function names seem different from the name mentioned in the function
> header.

Will fix both.

>
> 3)
>
> + /*
> + * Reset all index status back to invalid (while checking that we have
> + * processed all indexes).
> + */
> + for (int i = 0; i < pvs->nindexes; i++)
> + {
> + PVIndStats *stats = &(pvs->indstats[i]);
> +
> + Assert(stats->status == INDVAC_STATUS_COMPLETED);
> + stats->status = INDVAC_STATUS_INITIAL;
> + }
>
> Would it be safer if we report an error if any index's status is not
> INDVAC_STATUS_COMPLETED ?

Agreed. It'd be safer since even if some indexes are vacuumed due to a
bug vacuum errored out rather than continue it (and cause index
corruption).

Regards,

--
Masahiko Sawada
EDB: https://www.enterprisedb.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-11-24 02:20:23 Re: Skipping logical replication transactions on subscriber side
Previous Message Tom Lane 2021-11-24 02:17:22 Re: Mop-up from Test::More version change patch