diff options
| author | Tom Lane | 2002-09-26 22:46:29 +0000 |
|---|---|---|
| committer | Tom Lane | 2002-09-26 22:46:29 +0000 |
| commit | c87469e64a9b893b72254a1850c366fb04777430 (patch) | |
| tree | 0911f0193bd1badcc69ab5ff8d7d1e712388596f /src/include | |
| parent | 72f8efdc986eb06b0d7498d90c4ba6c1a94abba8 (diff) | |
Fix problems with loss of tuple commit status bits during WAL redo of
VACUUM FULL tuple moves. Store full-width t_infomask in WAL, rather
than storing low 8 bits and expecting to be able to reconstruct upper
bits. While at it, remove redundant t_oid field from WAL headers
(the OID, if present, is now recorded in the data portion of the tuple).
WAL version number bumped --- this does not force an initdb, you can
instead run pg_resetxlog after a clean shutdown of the old postmaster.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/access/htup.h | 19 | ||||
| -rw-r--r-- | src/include/access/xlog.h | 4 |
2 files changed, 17 insertions, 6 deletions
diff --git a/src/include/access/htup.h b/src/include/access/htup.h index 6da127e4d4b..f340c8143ac 100644 --- a/src/include/access/htup.h +++ b/src/include/access/htup.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: htup.h,v 1.60 2002/09/04 20:31:37 momjian Exp $ + * $Id: htup.h,v 1.61 2002/09/26 22:46:29 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -261,6 +261,8 @@ do { \ /* + * WAL record definitions for heapam.c's WAL operations + * * XLOG allows to store some information in high 4 bits of log * record xl_info field */ @@ -300,15 +302,22 @@ typedef struct xl_heap_delete #define SizeOfHeapDelete (offsetof(xl_heap_delete, target) + SizeOfHeapTid) +/* + * We don't store the whole fixed part (HeapTupleHeaderData) of an inserted + * or updated tuple in WAL; we can save a few bytes by reconstructing the + * fields that are available elsewhere in the WAL record, or perhaps just + * plain needn't be reconstructed. These are the fields we must store. + * NOTE: t_hoff could be recomputed, but we may as well store it because + * it will come for free due to alignment considerations. + */ typedef struct xl_heap_header { - Oid t_oid; int16 t_natts; + uint16 t_infomask; uint8 t_hoff; - uint8 mask; /* low 8 bits of t_infomask */ } xl_heap_header; -#define SizeOfHeapHeader (offsetof(xl_heap_header, mask) + sizeof(uint8)) +#define SizeOfHeapHeader (offsetof(xl_heap_header, t_hoff) + sizeof(uint8)) /* This is what we need to know about insert */ typedef struct xl_heap_insert @@ -340,6 +349,8 @@ typedef struct xl_heap_clean #define SizeOfHeapClean (offsetof(xl_heap_clean, block) + sizeof(BlockNumber)) + + /* * MaxTupleSize is the maximum allowed size of a tuple, including header and * MAXALIGN alignment padding. Basically it's BLCKSZ minus the other stuff diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h index bf2ce611f7f..c8c49936803 100644 --- a/src/include/access/xlog.h +++ b/src/include/access/xlog.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: xlog.h,v 1.37 2002/09/04 20:31:37 momjian Exp $ + * $Id: xlog.h,v 1.38 2002/09/26 22:46:29 tgl Exp $ */ #ifndef XLOG_H #define XLOG_H @@ -110,7 +110,7 @@ typedef struct XLogContRecord /* * Each page of XLOG file has a header like this: */ -#define XLOG_PAGE_MAGIC 0xD059 /* can be used as WAL version indicator */ +#define XLOG_PAGE_MAGIC 0xD05A /* can be used as WAL version indicator */ typedef struct XLogPageHeaderData { |
