Re: Flaky vacuum truncate test in reloptions.sql

Поиск
Список
Период
Сортировка
От Masahiko Sawada
Тема Re: Flaky vacuum truncate test in reloptions.sql
Дата
Msg-id CAD21AoAV221s7tuQ6=jLoxhCwZ_8iR6z-CLOwtgr8=77pvxJpA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Flaky vacuum truncate test in reloptions.sql  (Arseny Sher <a.sher@postgrespro.ru>)
Ответы Re: Flaky vacuum truncate test in reloptions.sql
Список pgsql-hackers
On Thu, Apr 1, 2021 at 12:08 PM Arseny Sher <a.sher@postgrespro.ru> wrote:
>
>
> Masahiko Sawada <sawada.mshk@gmail.com> writes:
>
> >> I don't think this matters much, as it tests the contrary and the
> >> probability of
> >> successful test passing (in case of theoretical bug making vacuum to
> >> truncate
> >> non-empty relation) becomes stunningly small. But adding it wouldn't hurt
> >> either.
> >
> > I was concerned a bit that without FREEZE in the first VACUUM we could
> > not test it properly because the table could not be truncated because
> > either vacuum_truncate is off
>
> FREEZE won't help us there.
>
> > or the page is skipped.
>
> You mean at the same time there is a potential bug in vacuum which would
> force the truncation of non-empy relation if the page wasn't locked?

Just to be clear the context, I’m mentioning the following test case:

CREATE TABLE reloptions_test(i INT NOT NULL, j text)
        WITH (vacuum_truncate=false,
        toast.vacuum_truncate=false,
        autovacuum_enabled=false);
SELECT reloptions FROM pg_class WHERE oid = 'reloptions_test'::regclass;
INSERT INTO reloptions_test VALUES (1, NULL), (NULL, NULL);
VACUUM reloptions_test;
SELECT pg_relation_size('reloptions_test') > 0;

What I meant is that without FREEZE option, there are two possible
cases where the table is not truncated (i.g.,
pg_relation_size('reloptions_test') > 0 is true): the page got empty
by vacuum but is not truncated because of vacuum_truncate = false, and
the page could not be vacuumed (i.g., tuples remain in the page)
because the page is skipped due to conflict on cleanup lock on the
page. This test is intended to test the former case. I guess adding
FREEZE will prevent the latter case.

Regards,

--
Masahiko Sawada
EDB:  https://www.enterprisedb.com/



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

Предыдущее
От: "osumi.takamichi@fujitsu.com"
Дата:
Сообщение: RE: Stronger safeguard for archive recovery not to miss data
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Support for NSS as a libpq TLS backend