Re: Strange assertion using VACOPT_FREEZE in vacuum.c

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Strange assertion using VACOPT_FREEZE in vacuum.c
Date: 2015-02-20 06:00:12
Message-ID: CAB7nPqQo7=_c4RxfECCihNSgh5Kkx3nM-NepTA+YaQdsOKGm+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 20, 2015 at 5:41 AM, Peter Eisentraut wrote:
> That's cool if you want to add those assertions, but please make them
> separate statements each, like
>
> Assert(vacstmt->options & (VACOPT_FULL | VACOPT_FREEZE) || vacstmt->freeze_min_age == -1);
> Assert(vacstmt->options & (VACOPT_FULL | VACOPT_FREEZE) || vacstmt->freeze_table_age == -1);
> ...
>
> Besides being more readable, this will give you more useful output if
> the assertion fails.

It makes sense. When a manual VACUUM FREEZE without options specified
without parenthesis, VACOPT_FREEZE is not used in gram.y, so ISTM that
we should change them to that instead:
Assert((vacstmt->options & VACOPT_VACUUM) ||
vacstmt->multixact_freeze_table_age == -1);
At least this would check that an ANALYZE does not set those
parameters inappropriately...
--
Michael

Attachment Content-Type Size
20150220_vacuum_freeze_fix_assertion_v3.patch application/x-patch 934 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alfred Perlstein 2015-02-20 06:09:42 Question about durability and postgresql.
Previous Message Noah Misch 2015-02-20 05:59:33 Re: pg_check_dir comments and implementation mismatch