Re: Add Index-level REINDEX with multiple jobs

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Add Index-level REINDEX with multiple jobs
Дата
Msg-id
2348025.1711332418@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Add Index-level REINDEX with multiple jobs Maxim Orlov <orlovmg@gmail.com>
Re: Add Index-level REINDEX with multiple jobs Michael Paquier <michael@paquier.xyz>
Re: Add Index-level REINDEX with multiple jobs Maxim Orlov <orlovmg@gmail.com>
Re: Add Index-level REINDEX with multiple jobs Alexander Korotkov <aekorotkov@gmail.com>
Re: Add Index-level REINDEX with multiple jobs Alexander Korotkov <aekorotkov@gmail.com>
Re: Add Index-level REINDEX with multiple jobs Tom Lane <tgl@sss.pgh.pa.us>
Re: Add Index-level REINDEX with multiple jobs Richard Guo <guofenglinux@gmail.com>
Re: Add Index-level REINDEX with multiple jobs Alexander Korotkov <aekorotkov@gmail.com>
Re: Add Index-level REINDEX with multiple jobs "Andrey M. Borodin" <x4mmm@yandex-team.ru>
Re: Add Index-level REINDEX with multiple jobs Svetlana Derevyanko <s.derevyanko@postgrespro.ru>
Alexander Korotkov  writes:
> Here goes the revised patch.  I'm going to push this if there are no objections.

Quite a lot of the buildfarm is complaining about this:

reindexdb.c: In function 'reindex_one_database':
reindexdb.c:434:54: error: 'indices_tables_cell' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  434 |     strcmp(prev_index_table_name, indices_tables_cell->val) == 0)
      |                                   ~~~~~~~~~~~~~~~~~~~^~~~~

I noticed it first on mamba, which is set up with -Werror, but a
scrape of the buildfarm logs shows many other animals reporting this
as a warning.  I think they are right.  Even granting that the
compiler realizes that "parallel && process_type == REINDEX_INDEX" is
enough to reach the one place where indices_tables_cell is
initialized, that's not really enough, because that place is

                if (indices_tables_list)
                    indices_tables_cell = indices_tables_list->head;

So I believe this code will crash if get_parallel_object_list returns
an empty list.  Initializing indices_tables_cell to NULL in its
declaration would stop the compiler warning, but if I'm right it
will do nothing to prevent that crash.  This needs a bit more effort.

			regards, tom lane


В списке pgsql-hackers по дате отправления
От: Noah Misch
Дата:
От: Richard Guo
Дата:
FAQ