Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b3AQy-0006P4-Ru for pgsql-hackers@arkaria.postgresql.org; Wed, 18 May 2016 22:59:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b3AQy-0002Yy-2Z for pgsql-hackers@arkaria.postgresql.org; Wed, 18 May 2016 22:59:20 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b3APc-00010a-Jt for pgsql-hackers@postgresql.org; Wed, 18 May 2016 22:57:56 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1b3APZ-0000RM-4R for pgsql-hackers@postgresql.org; Wed, 18 May 2016 22:57:55 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [216.155.90.98]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 0A7654008D8; Wed, 18 May 2016 15:57:52 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id EC5C5806; Wed, 18 May 2016 18:57:49 -0400 (CLT) Date: Wed, 18 May 2016 18:57:49 -0400 From: Alvaro Herrera To: Andres Freund Cc: Tom Lane , Josh berkus , Peter Geoghegan , Jeff Janes , Joe Conway , Victor Yegorov , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: Reviewing freeze map code Message-ID: <20160518225749.GA288644@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160518223436.w32fzgoui6gaaj4p@alap3.anarazel.de> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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