Document that vacuum can't truncate if old_snapshot_threshold >= 0

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Document that vacuum can't truncate if old_snapshot_threshold >= 0
Дата
Msg-id 20160713211406.cf6yjq6577ici7mc@alap3.anarazel.de
обсуждение исходный текст
Ответы Re: Document that vacuum can't truncate if old_snapshot_threshold >= 0  (Noah Misch <noah@leadboat.com>)
Re: Document that vacuum can't truncate if old_snapshot_threshold >= 0  (Kevin Grittner <kgrittn@gmail.com>)
Список pgsql-hackers
Hi,

Currently, if old_snapshot_threshold is enabled, vacuum is prevented
from truncating tables:
static bool
should_attempt_truncation(LVRelStats *vacrelstats)
{BlockNumber possibly_freeable;
possibly_freeable = vacrelstats->rel_pages - vacrelstats->nonempty_pages;if (possibly_freeable > 0 &&
(possibly_freeable>= REL_TRUNCATE_MINIMUM ||  possibly_freeable >= vacrelstats->rel_pages / REL_TRUNCATE_FRACTION) &&
old_snapshot_threshold < 0)    return true;else    return false;
 
}

(note the old_snapshot_threshold < 0 condition).

That appears to not be mentioned in a comment, the commit message or the
the docs. I think this definitely needs to be prominently documented.

FWIW, afaics that's required because new pages don't have an LSN, so we
can't necessarily detect that a truncated and re-extended relation,
wouldn't be valid. Although I do wonder if there isn't a less invasive
way to do that.

Greetings,

Andres Freund



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: pgbench - allow to store select results into variables