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

Commitc77a29a

Browse files
committed
Substantial rewrite of async.c to avoid problems with non-reentrant stdio
and possibly other problems. Minor changes in xact.c and postgres.c'smain loop to support new handling of async NOTIFY.
1 parente7e027a commitc77a29a

File tree

7 files changed

+645
-511
lines changed

7 files changed

+645
-511
lines changed

‎src/backend/access/transam/xact.c

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.23 1998/09/01 04:27:19 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.24 1998/10/06 02:39:58 tgl Exp $
1111
*
1212
* NOTES
1313
*Transaction aborts can now occur two ways:
@@ -901,6 +901,9 @@ CommitTransaction()
901901
/* handle commit for large objects [ PA, 7/17/98 ] */
902902
_lo_commit();
903903

904+
/* NOTIFY commit must also come before lower-level cleanup */
905+
AtCommit_Notify();
906+
904907
CloseSequences();
905908
DestroyTempRels();
906909
AtEOXact_portals();
@@ -916,10 +919,6 @@ CommitTransaction()
916919
* ----------------
917920
*/
918921
s->state=TRANS_DEFAULT;
919-
{/* want this after commit */
920-
if (IsNormalProcessingMode())
921-
Async_NotifyAtCommit();
922-
}
923922

924923
/*
925924
* Let others to know about no transaction in progress - vadim
@@ -967,6 +966,7 @@ AbortTransaction()
967966
*do abort processing
968967
* ----------------
969968
*/
969+
AtAbort_Notify();
970970
CloseSequences();
971971
AtEOXact_portals();
972972
RecordTransactionAbort();
@@ -982,17 +982,6 @@ AbortTransaction()
982982
* ----------------
983983
*/
984984
s->state=TRANS_DEFAULT;
985-
{
986-
987-
/*
988-
* We need to do this in case another process notified us while we
989-
* are in the middle of an aborted transaction. We need to notify
990-
* our frontend after we finish the current transaction. -- jw,
991-
* 1/3/94
992-
*/
993-
if (IsNormalProcessingMode())
994-
Async_NotifyAtAbort();
995-
}
996985
}
997986

998987
/* --------------------------------
@@ -1455,6 +1444,30 @@ UserAbortTransactionBlock()
14551444
s->blockState=TBLOCK_ENDABORT;
14561445
}
14571446

1447+
/* --------------------------------
1448+
*AbortOutOfAnyTransaction
1449+
*
1450+
* This routine is provided for error recovery purposes. It aborts any
1451+
* active transaction or transaction block, leaving the system in a known
1452+
* idle state.
1453+
* --------------------------------
1454+
*/
1455+
void
1456+
AbortOutOfAnyTransaction()
1457+
{
1458+
TransactionStates=CurrentTransactionState;
1459+
1460+
/*
1461+
* Get out of any low-level transaction
1462+
*/
1463+
if (s->state!=TRANS_DEFAULT)
1464+
AbortTransaction();
1465+
/*
1466+
* Now reset the high-level state
1467+
*/
1468+
s->blockState=TBLOCK_DEFAULT;
1469+
}
1470+
14581471
bool
14591472
IsTransactionBlock()
14601473
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp