Re: Data loss, vacuum, transaction wrap-around

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Data loss, vacuum, transaction wrap-around
Дата
Msg-id 87mzu1wr2a.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: Data loss, vacuum, transaction wrap-around  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Data loss, vacuum, transaction wrap-around  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> > (3) When the XID count goes past the "trip wire" can it spontaneously
> > issue a vacuum?
> 
> Only in the database you're connected to, which very likely isn't where
> the problem is.  Moreover, having N backends all decide they need to do
> this at once doesn't sound like a winner.  Furthermore, this still
> presumes the existence of the hard part of the solution, which is
> knowing where the trip point is.

Alright, I have a suggestion. If the database kept a "oldest xid" for each
table then there wouldn't be any expensive work to scan the table looking for
an oldest xid. The only time "oldest xid" needs to be updated is when vacuum
is run, which is precisely when it would be known.

There could be a per-database "oldest xid" that any vacuum on any table
updates (by skimming all the "oldest xid"s for the current database). If
that's stored in the shared pg_database table then it's accessible regardless
of what database you connect to, no?

Then on every connection and every n-thousandth transaction you just have to
check the "oldest xid" for all the databases, and make sure the difference
between the oldest one and the current xid is reasonable.

-- 
greg



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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Data loss, vacuum, transaction wrap-around
Следующее
От: Tom Lane
Дата:
Сообщение: Get rid of system attributes in pg_attribute?