Re: Autovacuum breakage from a734fd5d1

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Autovacuum breakage from a734fd5d1
Дата
Msg-id 3025.1480300439@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Autovacuum breakage from a734fd5d1  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Autovacuum breakage from a734fd5d1
Re: Autovacuum breakage from a734fd5d1
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> Thanks for digging into this.  I failed to notice while reviewing that
> the way we were printing the message had changed a bit in the new
> code, and I just totally overlooked the existing locking hazards.
> Oops.

I pushed a patch to deal with this.  I ended up simplifying the previous
commit considerably by getting rid of the commit-multiple-deletions-per-
transaction business.  I do not think that this code will get exercised
enough, either in the field or in testing, to justify taking a risk of
additional bugs from that.

Also, another reason for not liking that is that it seems to increase the
risk of deadlock against an incoming session that's taking over the temp
schema belonging to a crashed session.  The incoming backend would be
deleting the same tables in (probably) a different order, which is an
obvious deadlock hazard.  I think it'd be mostly all right because the
autovac worker should lose deadlock fights, but the incoming session would
see a deadlock_timeout stall if not an error.  So that's another reason to
commit immediately after each deletion.

I tested this by dint of turning RemoveTempRelationsCallback into a no-op,
so that things always acted as though sessions had crashed without
cleaning up their temp tables.  The code survived quite a few regression
test cycles without visible problems, although I had to tweak rules.sql
to ignore temp views.
        regards, tom lane



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

Предыдущее
От: "Tsunakawa, Takayuki"
Дата:
Сообщение: Re: UNDO and in-place update
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Autovacuum breakage from a734fd5d1