Re: BUG #18426: Canceling vacuum while truncating a relation leads to standby PANIC

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: BUG #18426: Canceling vacuum while truncating a relation leads to standby PANIC
Дата
Msg-id CA+hUKGLbEARhvBXPL45VniV9O4h5AUocQXJ4YHrMVvK2=0JpFQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #18426: Canceling vacuum while truncating a relation leads to standby PANIC  (Alexander Lakhin <exclusion@gmail.com>)
Ответы Re: BUG #18426: Canceling vacuum while truncating a relation leads to standby PANIC  (Thomas Munro <thomas.munro@gmail.com>)
Re: BUG #18426: Canceling vacuum while truncating a relation leads to standby PANIC  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-bugs
On Thu, Apr 11, 2024 at 6:00 AM Alexander Lakhin <exclusion@gmail.com> wrote:
> 10.04.2024 14:00, PG Bug reporting form wrote:
> > The following bug has been logged on the website:
> >
> > Bug reference:      18426
> > ...
> > A demo test for the issue to follow...

I didn't try your test but your explanation seems clear.
RelationTruncate() logs first, then calls smgrtruncate() which drops
buffers and then truncates files.  The dropping-the-buffers phase is
now interruptible, since commit d87251048a0f.  If you interrupt it
there, the situation is bad: you have logged the truncation, but left
(1) buffers and (2) untruncated files on the primary.  Relation size
being out of sync is a recipe for that PANIC next time the WAL
mentions blocks past the (primary's) end.  First thought is that that
particular wait might need to hold interrupts.  Hmm.  The comments for
RelationTruncate() contemplate but reject a critical section.
Presumably it's waiting for another backend to flush data, and that
other backend will eventually finish doing that or fail/crash.



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #18422: Assert in expandTupleDesc() fails on row mismatch with additional SRF
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: BUG #18426: Canceling vacuum while truncating a relation leads to standby PANIC