Re: Strange assertion using VACOPT_FREEZE in vacuum.c

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Strange assertion using VACOPT_FREEZE in vacuum.c
Date: 2015-02-18 06:26:50
Message-ID: CAB7nPqSiE3SHi0b7MDQpgT2mp-6s-1jwu3vKqip9t1inTw1Mzg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 18, 2015 at 10:06 AM, Michael Paquier wrote:
> Yes, the existing assertion is right. My point is that it is strange
> that we do not check the values of freeze parameters for an ANALYZE
> query, which should be set to -1 all the time. If this is thought as
> not worth checking, I'll drop this patch and my concerns.

Perhaps this explains better what I got in mind, aka making the
assertion stricter:
Assert((vacstmt->options & VACOPT_VACUUM) ||
- !(vacstmt->options & (VACOPT_FULL | VACOPT_FREEZE)));
+ ((vacstmt->options & (VACOPT_FULL | VACOPT_FREEZE)) == 0 &&
+ vacstmt->freeze_min_age < 0 &&
+ vacstmt->freeze_table_age < 0 &&
+ vacstmt->multixact_freeze_min_age < 0 &&
+ vacstmt->multixact_freeze_table_age < 0));

Regards,
--
Michael

Attachment Content-Type Size
20150218_vacuum_freeze_fix_assertion_v2.patch application/x-patch 833 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-02-18 06:44:04 Re: Perl coding error in msvc build system?
Previous Message Abhijit Menon-Sen 2015-02-18 06:12:38 Re: pgaudit - an auditing extension for PostgreSQL