pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Josh berkus <josh@agliodbs.com>
Cc: Peter Geoghegan <pg@heroku.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Joe Conway <mail@joeconway.com>
Cc: Victor Yegorov <vyegorov@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Reviewing freeze map code
Date: Wed, 18 May 2016 18:57:49 -0400
Message-ID: <20160518225749.GA288644@alvherre.pgsql> (raw)
In-Reply-To: <20160518223436.w32fzgoui6gaaj4p@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Andres Freund wrote:

> > (AFAIK, "select count(*) from table" would offer a similar amount of
> > sanity checking as a full-table VACUUM scan does, so it's not like
> > we've removed functionality with no near-term replacement.)
> 
> I don't think that'd do anything comparable to
> 		/*
> 		 * As of PostgreSQL 9.2, the visibility map bit should never be set if
> 		 * the page-level bit is clear.  However, it's possible that the bit
> 		 * got cleared after we checked it and before we took the buffer
> 		 * content lock, so we must recheck before jumping to the conclusion
> 		 * that something bad has happened.
> 		 */
> 		else if (all_visible_according_to_vm && !PageIsAllVisible(page)
> 				 && VM_ALL_VISIBLE(onerel, blkno, &vmbuffer))
> 		{
> 			elog(WARNING, "page is not marked all-visible but visibility map bit is set in relation \"%s\" page %u",
> 				 relname, blkno);
> 			visibilitymap_clear(onerel, blkno, vmbuffer);
> 		}
> 
> If we had a checking module for all this it'd possibly be sufficient,
> but we don't.

Here's an idea.  We need core-blessed extensions (src/extensions/, you
know I've proposed this before), so why not take this opportunity to
create our first such and make it carry a function to scan a table
completely to do this task.

Since we were considering a new VACUUM option, surely this is serious
enough to warrant more than just contrib.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (256+ messages)  latest in thread

Message-ID: <20160518225749.GA288644@alvherre.pgsql>
Permalink:  ../20160518225749.GA288644@alvherre.pgsql/
Also on:    postgresql.org/message-id/20160518225749.GA288644@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com, andres@anarazel.de, tgl@sss.pgh.pa.us, josh@agliodbs.com, pg@heroku.com, jeff.janes@gmail.com, mail@joeconway.com, vyegorov@gmail.com, robertmhaas@gmail.com
  Subject: Re: Reviewing freeze map code
  In-Reply-To: <20160518225749.GA288644@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox