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

Commit66b0984

Browse files
committed
Dept. of second thoughts: regular COMMIT deletes deletable files before
releasing locks, so COMMIT PREPARED should too.
1 parent25f8916 commit66b0984

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
*$PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.1 2005/06/17 22:32:42 tgl Exp $
10+
*$PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.2 2005/06/18 05:21:09 tgl Exp $
1111
*
1212
* NOTES
1313
*Each global transaction is associated with a global transaction
@@ -1114,13 +1114,11 @@ FinishPreparedTransaction(char *gid, bool isCommit)
11141114
*/
11151115
gxact->valid= false;
11161116

1117-
if (isCommit)
1118-
ProcessRecords(bufptr,xid,twophase_postcommit_callbacks);
1119-
else
1120-
ProcessRecords(bufptr,xid,twophase_postabort_callbacks);
1121-
11221117
/*
1123-
* We also have to remove any files that were supposed to be dropped.
1118+
* We have to remove any files that were supposed to be dropped.
1119+
* For consistency with the regular xact.c code paths, must do this
1120+
* before releasing locks, so do it before running the callbacks.
1121+
*
11241122
* NB: this code knows that we couldn't be dropping any temp rels ...
11251123
*/
11261124
if (isCommit)
@@ -1134,6 +1132,12 @@ FinishPreparedTransaction(char *gid, bool isCommit)
11341132
smgrdounlink(smgropen(abortrels[i]), false, false);
11351133
}
11361134

1135+
/* And now do the callbacks */
1136+
if (isCommit)
1137+
ProcessRecords(bufptr,xid,twophase_postcommit_callbacks);
1138+
else
1139+
ProcessRecords(bufptr,xid,twophase_postabort_callbacks);
1140+
11371141
pgstat_count_xact_commit();
11381142

11391143
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp