File tree Expand file tree Collapse file tree 5 files changed +34
-18
lines changed Expand file tree Collapse file tree 5 files changed +34
-18
lines changed Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.30 1999/07/17 20:16:42 momjian Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v 1.31 1999/08/08 20:12:50 tgl Exp $
12
12
*
13
13
* NOTES
14
14
* Postgres btree pages look like ordinary relation pages. The opaque
@@ -42,7 +42,6 @@ typedef struct BTMetaPageData
42
42
#define BTPageGetMeta (p ) \
43
43
((BTMetaPageData *) &((PageHeader) p)->pd_linp[0])
44
44
45
- extern bool BuildingBtree ;
46
45
47
46
/*
48
47
* We use high-concurrency locking on btrees. There are two cases in
Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.27 1999/07/15 23:03:00 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.28 1999/08/08 20:12:51 tgl Exp $
11
11
*
12
12
*
13
13
* NOTES
@@ -43,6 +43,28 @@ static BTScanList BTScans = (BTScanList) NULL;
43
43
44
44
static void _bt_scandel (IndexScanDesc scan , BlockNumber blkno , OffsetNumber offno );
45
45
46
+ /*
47
+ * AtEOXact_nbtree() --- clean up nbtree subsystem at xact abort or commit.
48
+ *
49
+ * This is here because it needs to touch this module's static var BTScans.
50
+ */
51
+ void
52
+ AtEOXact_nbtree (void )
53
+ {
54
+ /* Note: these actions should only be necessary during xact abort;
55
+ * but they can't hurt during a commit.
56
+ */
57
+
58
+ /* Reset the active-scans list to empty.
59
+ * We do not need to free the list elements, because they're all
60
+ * palloc()'d, so they'll go away at end of transaction anyway.
61
+ */
62
+ BTScans = NULL ;
63
+
64
+ /* If we were building a btree, we ain't anymore. */
65
+ BuildingBtree = false;
66
+ }
67
+
46
68
/*
47
69
* _bt_regscan() -- register a new scan.
48
70
*/
Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.30 1999/07/15 23:03:02 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.31 1999/08/08 20:12:52 tgl Exp $
11
11
*
12
12
* NOTES
13
13
* This file contains the high level access-method interface to the
20
20
21
21
#include "access/heapam.h"
22
22
#include "catalog/catname.h"
23
- #include "commands/vacuum.h"
24
23
25
24
static int RecoveryCheckingEnabled (void );
26
25
static void TransRecover (Relation logRelation );
@@ -83,12 +82,6 @@ int RecoveryCheckingEnableState = 0;
83
82
*/
84
83
extern int OidGenLockId ;
85
84
86
- /* ----------------
87
- * globals that must be reset at abort
88
- * ----------------
89
- */
90
- extern bool BuildingBtree ;
91
-
92
85
93
86
/* ----------------
94
87
* recovery checking accessors
@@ -568,11 +561,6 @@ TransactionIdCommit(TransactionId transactionId)
568
561
void
569
562
TransactionIdAbort (TransactionId transactionId )
570
563
{
571
- BuildingBtree = false;
572
-
573
- if (VacuumRunning )
574
- vc_abort ();
575
-
576
564
if (AMI_OVERRIDE )
577
565
return ;
578
566
Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.46 1999/07/16 04:58:33 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.47 1999/08/08 20:12:52 tgl Exp $
11
11
*
12
12
* NOTES
13
13
* Transaction aborts can now occur two ways:
144
144
*/
145
145
#include "postgres.h"
146
146
147
+ #include "access/nbtree.h"
147
148
#include "catalog/heap.h"
148
149
#include "commands/async.h"
149
150
#include "commands/sequence.h"
151
+ #include "commands/vacuum.h"
150
152
#include "libpq/be-fsstubs.h"
151
153
#include "storage/proc.h"
152
154
#include "utils/inval.h"
@@ -952,6 +954,7 @@ CommitTransaction()
952
954
}
953
955
954
956
RelationPurgeLocalRelation (true);
957
+ AtEOXact_nbtree ();
955
958
AtCommit_Cache ();
956
959
AtCommit_Locks ();
957
960
AtCommit_Memory ();
@@ -1013,9 +1016,12 @@ AbortTransaction()
1013
1016
AtAbort_Notify ();
1014
1017
CloseSequences ();
1015
1018
AtEOXact_portals ();
1019
+ if (VacuumRunning )
1020
+ vc_abort ();
1016
1021
RecordTransactionAbort ();
1017
1022
RelationPurgeLocalRelation (false);
1018
1023
DestroyNoNameRels ();
1024
+ AtEOXact_nbtree ();
1019
1025
AtAbort_Cache ();
1020
1026
AtAbort_Locks ();
1021
1027
AtAbort_Memory ();
Original file line number Diff line number Diff line change 6
6
*
7
7
* Copyright (c) 1994, Regents of the University of California
8
8
*
9
- * $Id: nbtree.h,v 1.30 1999/07/16 17:07:27 momjian Exp $
9
+ * $Id: nbtree.h,v 1.31 1999/08/08 20:12:49 tgl Exp $
10
10
*
11
11
*-------------------------------------------------------------------------
12
12
*/
@@ -250,6 +250,7 @@ extern void btdelete(Relation rel, ItemPointer tid);
250
250
extern void _bt_regscan (IndexScanDesc scan );
251
251
extern void _bt_dropscan (IndexScanDesc scan );
252
252
extern void _bt_adjscans (Relation rel , ItemPointer tid );
253
+ extern void AtEOXact_nbtree (void );
253
254
254
255
/*
255
256
* prototypes for functions in nbtsearch.c
You can’t perform that action at this time.
0 commit comments