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
Re: Document that vacuum can't truncate if old_snapshot_threshold >= 0 |
| Список | 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 по дате отправления: