aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/async.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-08-20 00:40:32 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-08-20 00:40:32 +0000
commitf57e3f4cf36f3fdd89cae8d566479ad747809b2f (patch)
tree6cb7a1b32271692929ecef6be67a823c9d29cf3f /src/backend/commands/async.c
parent97bb6e89beed326aae1990d798107b4af9a9af02 (diff)
downloadpostgresql-f57e3f4cf36f3fdd89cae8d566479ad747809b2f.tar.gz
postgresql-f57e3f4cf36f3fdd89cae8d566479ad747809b2f.zip
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/backend/commands/async.c')
-rw-r--r--src/backend/commands/async.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c
index 142b02dfaf8..e2c6203891d 100644
--- a/src/backend/commands/async.c
+++ b/src/backend/commands/async.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.123 2005/06/17 22:32:43 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.124 2005/08/20 00:39:53 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -550,8 +550,9 @@ AtCommit_Notify(void)
}
else if (listener->notification == 0)
{
- ItemPointerData ctid;
HTSU_Result result;
+ ItemPointerData update_ctid;
+ TransactionId update_xmax;
rTuple = heap_modifytuple(lTuple, tdesc,
value, nulls, repl);
@@ -573,7 +574,7 @@ AtCommit_Notify(void)
* heap_update calls.
*/
result = heap_update(lRel, &lTuple->t_self, rTuple,
- &ctid,
+ &update_ctid, &update_xmax,
GetCurrentCommandId(), InvalidSnapshot,
false /* no wait for commit */ );
switch (result)
@@ -585,7 +586,6 @@ AtCommit_Notify(void)
case HeapTupleMayBeUpdated:
/* done successfully */
-
#ifdef NOT_USED /* currently there are no indexes */
CatalogUpdateIndexes(lRel, rTuple);
#endif