7
7
* Portions Copyright (c) 1994, Regents of the University of California
8
8
*
9
9
* 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 $
11
11
*
12
12
* NOTES
13
13
* Each global transaction is associated with a global transaction
@@ -1114,13 +1114,11 @@ FinishPreparedTransaction(char *gid, bool isCommit)
1114
1114
*/
1115
1115
gxact -> valid = false;
1116
1116
1117
- if (isCommit )
1118
- ProcessRecords (bufptr , xid , twophase_postcommit_callbacks );
1119
- else
1120
- ProcessRecords (bufptr , xid , twophase_postabort_callbacks );
1121
-
1122
1117
/*
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
+ *
1124
1122
* NB: this code knows that we couldn't be dropping any temp rels ...
1125
1123
*/
1126
1124
if (isCommit )
@@ -1134,6 +1132,12 @@ FinishPreparedTransaction(char *gid, bool isCommit)
1134
1132
smgrdounlink (smgropen (abortrels [i ]), false, false);
1135
1133
}
1136
1134
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
+
1137
1141
pgstat_count_xact_commit ();
1138
1142
1139
1143
/*
0 commit comments