1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-21 10:42:50 +03:00

Fix a violation of WAL coding rules in the recent patch to include an

"all tuples visible" flag in heap page headers.  The flag update *must*
be applied before calling XLogInsert, but heap_update and the tuple
moving routines in VACUUM FULL were ignoring this rule.  A crash and
replay could therefore leave the flag incorrectly set, causing rows
to appear visible in seqscans when they should not be.  This might explain
recent reports of data corruption from Jeff Ross and others.

In passing, do a bit of editorialization on comments in visibilitymap.c.
This commit is contained in:
Tom Lane
2009-08-24 02:18:32 +00:00
parent cab9a0656c
commit 7fc7a7c4d0
6 changed files with 112 additions and 90 deletions

View File

@@ -7,17 +7,17 @@
* Portions Copyright (c) 2007-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/access/visibilitymap.h,v 1.4 2009/06/11 14:49:09 momjian Exp $
* $PostgreSQL: pgsql/src/include/access/visibilitymap.h,v 1.5 2009/08/24 02:18:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef VISIBILITYMAP_H
#define VISIBILITYMAP_H
#include "utils/relcache.h"
#include "storage/buf.h"
#include "storage/itemptr.h"
#include "access/xlogdefs.h"
#include "storage/block.h"
#include "storage/buf.h"
#include "utils/relcache.h"
extern void visibilitymap_clear(Relation rel, BlockNumber heapBlk);
extern void visibilitymap_pin(Relation rel, BlockNumber heapBlk,