On Fri, Nov 19, 2021 at 11:25 AM houzj.f...@fujitsu.com <houzj.f...@fujitsu.com> wrote: > > On Tues, Nov 16, 2021 1:53 PM Masahiko Sawada <sawada.m...@gmail.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/