diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-08-20 00:40:32 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-08-20 00:40:32 +0000 |
| commit | f57e3f4cf36f3fdd89cae8d566479ad747809b2f (patch) | |
| tree | 6cb7a1b32271692929ecef6be67a823c9d29cf3f /src/include/access/heapam.h | |
| parent | 97bb6e89beed326aae1990d798107b4af9a9af02 (diff) | |
| download | postgresql-f57e3f4cf36f3fdd89cae8d566479ad747809b2f.tar.gz | |
Repair problems with VACUUM destroying t_ctid chains too soon, and with
insufficient paranoia in code that follows t_ctid links. (We must do both
because even with VACUUM doing it properly, the intermediate state with
a dangling t_ctid link is visible concurrently during lazy VACUUM, and
could be seen afterwards if either type of VACUUM crashes partway through.)
Also try to improve documentation about what's going on. Patch is a bit
bulky because passing the XMAX information around required changing the
APIs of some low-level heapam.c routines, but it's not conceptually very
complicated. Per trouble report from Teodor and subsequent analysis.
This needs to be back-patched, but I'll do that after 8.1 beta is out.
Diffstat (limited to 'src/include/access/heapam.h')
| -rw-r--r-- | src/include/access/heapam.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index 9c040b0dfd..3221734a6f 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.103 2005/08/01 20:31:13 tgl Exp $ + * $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.104 2005/08/20 00:39:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -152,19 +152,23 @@ extern bool heap_release_fetch(Relation relation, Snapshot snapshot, HeapTuple tuple, Buffer *userbuf, bool keep_buf, PgStat_Info *pgstat_info); -extern ItemPointer heap_get_latest_tid(Relation relation, Snapshot snapshot, +extern void heap_get_latest_tid(Relation relation, Snapshot snapshot, ItemPointer tid); extern void setLastTid(const ItemPointer tid); extern Oid heap_insert(Relation relation, HeapTuple tup, CommandId cid, bool use_wal, bool use_fsm); -extern HTSU_Result heap_delete(Relation relation, ItemPointer tid, ItemPointer ctid, - CommandId cid, Snapshot crosscheck, bool wait); -extern HTSU_Result heap_update(Relation relation, ItemPointer otid, HeapTuple tup, - ItemPointer ctid, CommandId cid, Snapshot crosscheck, bool wait); -extern HTSU_Result heap_lock_tuple(Relation relation, HeapTuple tup, - Buffer *userbuf, CommandId cid, - LockTupleMode mode, bool nowait); +extern HTSU_Result heap_delete(Relation relation, ItemPointer tid, + ItemPointer ctid, TransactionId *update_xmax, + CommandId cid, Snapshot crosscheck, bool wait); +extern HTSU_Result heap_update(Relation relation, ItemPointer otid, + HeapTuple newtup, + ItemPointer ctid, TransactionId *update_xmax, + CommandId cid, Snapshot crosscheck, bool wait); +extern HTSU_Result heap_lock_tuple(Relation relation, HeapTuple tuple, + Buffer *buffer, ItemPointer ctid, + TransactionId *update_xmax, CommandId cid, + LockTupleMode mode, bool nowait); extern Oid simple_heap_insert(Relation relation, HeapTuple tup); extern void simple_heap_delete(Relation relation, ItemPointer tid); |
