aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-01-13 21:32:12 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-01-13 21:32:12 +0000
commit39fc1fb07ad237b1f5cc5516f75969dbcbfaec82 (patch)
tree256c7cf67942e0565484d2d43fee2781ec0a2059 /src
parent7d6d02b640395bb2f43c01a134d92ff080e82b34 (diff)
downloadpostgresql-39fc1fb07ad237b1f5cc5516f75969dbcbfaec82.tar.gz
postgresql-39fc1fb07ad237b1f5cc5516f75969dbcbfaec82.zip
Remove logic in XactLockTableWait() that attempted to mark a crashed
transaction as aborted. Since we only call XactLockTableWait on XIDs that we believe to be currently running, the odds of this code ever actually firing are minimal. It's certainly unnecessary, since a transaction that's not either running or committed will be presumed aborted anyway. What's more, it's not hard to imagine scenarios where this could result in corrupting pg_clog: for instance, if a bogus XID somehow got passed to XactLockTableWait. I think the code probably dates from the ancient era when we didn't have TransactionIdIsInProgress; back then it may have been necessary, but now I think it's a waste of cycles and potentially dangerous. Per discussion with Qingqing Zhou and Karsten Hilbert.
Diffstat (limited to 'src')
-rw-r--r--src/backend/storage/lmgr/lmgr.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/backend/storage/lmgr/lmgr.c b/src/backend/storage/lmgr/lmgr.c
index 60e374959b0..9e3ff591e4e 100644
--- a/src/backend/storage/lmgr/lmgr.c
+++ b/src/backend/storage/lmgr/lmgr.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/lmgr/lmgr.c,v 1.80 2005/12/09 01:22:04 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/lmgr/lmgr.c,v 1.81 2006/01/13 21:32:12 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -383,13 +383,6 @@ XactLockTableWait(TransactionId xid)
break;
xid = SubTransGetParent(xid);
}
-
- /*
- * Transaction was committed/aborted/crashed - we have to update pg_clog
- * if transaction is still marked as running.
- */
- if (!TransactionIdDidCommit(xid) && !TransactionIdDidAbort(xid))
- TransactionIdAbort(xid);
}
/*
@@ -421,13 +414,6 @@ ConditionalXactLockTableWait(TransactionId xid)
xid = SubTransGetParent(xid);
}
- /*
- * Transaction was committed/aborted/crashed - we have to update pg_clog
- * if transaction is still marked as running.
- */
- if (!TransactionIdDidCommit(xid) && !TransactionIdDidAbort(xid))
- TransactionIdAbort(xid);
-
return true;
}