Re: BUG #18127: Assertion HaveRegisteredOrActiveSnapshot failed on REINDEX CONCURRENTLY when blocksize=1

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: BUG #18127: Assertion HaveRegisteredOrActiveSnapshot failed on REINDEX CONCURRENTLY when blocksize=1
Дата
Msg-id 20230928162519.43eg6m6g2axqqz5e@alap3.anarazel.de
обсуждение исходный текст
Ответ на BUG #18127: Assertion HaveRegisteredOrActiveSnapshot failed on REINDEX CONCURRENTLY when blocksize=1  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
Hi,

On 2023-09-21 11:00:01 +0000, PG Bug reporting form wrote:
> A server compiled --with-blocksize=1 produces an assertion failure on
> `make check`. More specifically, the failure triggered on a query like:
> CREATE TABLE concur_reindex_tab (c1 int PRIMARY KEY);
> CREATE TABLE concur_reindex_tab2 (c1 int REFERENCES concur_reindex_tab);
> REINDEX INDEX CONCURRENTLY concur_reindex_tab_pkey;

> I think that the blocksize matters here just because it allows to reach
> toast_delete_datum() inside index_concurrently_swap(). Perhaps the same
> effect could be seen with the default block size, but with larger tuples
> in pg_constraint (I haven't tried to construct such tuples yet).

It seems we ought to move some assertions further up the call stacks, so that
they're hit independent of whether we actually end up toasting or
not. Otherwise it's too hard to find these problems.

Seems like we ought to have assertions in places like pg_detoast_datum(),
heap_insert(), heap_update(), heap_delete()? They all can lead to needing
toasting.

It's possible that there are some bootstrap cases or such where it's ok that
we don't have a snapshot, and that we need to weaken the assertions for that,
but that'd be ok.


> This issue is not the same as [1], because in this case I really see no
> registered or active snapshots.

Yea, it indeed looks like a real issue.

Greetings,

Andres Freund



В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #18138: Using limit on VALUES causes type conversion to fail.
Следующее
От: Andres Freund
Дата:
Сообщение: Re: BUG #18127: Assertion HaveRegisteredOrActiveSnapshot failed on REINDEX CONCURRENTLY when blocksize=1