On Wed, Nov 24, 2021 at 7:48 AM Masahiko Sawada <sawada.m...@gmail.com> wrote: > > On Fri, Nov 19, 2021 at 11:25 AM houzj.f...@fujitsu.com > <houzj.f...@fujitsu.com> wrote: > > > > 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). >
I think if we want to report an error in this case, we should use elog as this is an internal error. -- With Regards, Amit Kapila.