Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit39fc1fb

Browse files
committed
Remove logic in XactLockTableWait() that attempted to mark a crashed
transaction as aborted. Since we only call XactLockTableWait on XIDsthat we believe to be currently running, the odds of this code everactually firing are minimal. It's certainly unnecessary, since atransaction that's not either running or committed will be presumedaborted anyway. What's more, it's not hard to imagine scenarios wherethis could result in corrupting pg_clog: for instance, if a bogus XIDsomehow got passed to XactLockTableWait. I think the code probablydates 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 ofcycles and potentially dangerous. Per discussion with Qingqing Zhouand Karsten Hilbert.
1 parent7d6d02b commit39fc1fb

File tree

1 file changed

+1
-15
lines changed
  • src/backend/storage/lmgr

1 file changed

+1
-15
lines changed

‎src/backend/storage/lmgr/lmgr.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lmgr.c,v 1.80 2005/12/09 01:22:04 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lmgr.c,v 1.81 2006/01/13 21:32:12 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -383,13 +383,6 @@ XactLockTableWait(TransactionId xid)
383383
break;
384384
xid=SubTransGetParent(xid);
385385
}
386-
387-
/*
388-
* Transaction was committed/aborted/crashed - we have to update pg_clog
389-
* if transaction is still marked as running.
390-
*/
391-
if (!TransactionIdDidCommit(xid)&& !TransactionIdDidAbort(xid))
392-
TransactionIdAbort(xid);
393386
}
394387

395388
/*
@@ -421,13 +414,6 @@ ConditionalXactLockTableWait(TransactionId xid)
421414
xid=SubTransGetParent(xid);
422415
}
423416

424-
/*
425-
* Transaction was committed/aborted/crashed - we have to update pg_clog
426-
* if transaction is still marked as running.
427-
*/
428-
if (!TransactionIdDidCommit(xid)&& !TransactionIdDidAbort(xid))
429-
TransactionIdAbort(xid);
430-
431417
return true;
432418
}
433419

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp