InnoDB Plugin  1.0
trx0purge.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation; version 2 of the License.
8 
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16 
17 *****************************************************************************/
18 
19 /**************************************************/
26 #ifndef trx0purge_h
27 #define trx0purge_h
28 
29 #include "univ.i"
30 #include "trx0types.h"
31 #include "mtr0mtr.h"
32 #include "trx0sys.h"
33 #include "que0types.h"
34 #include "page0page.h"
35 #include "usr0sess.h"
36 #include "fil0fil.h"
37 
39 extern trx_purge_t* purge_sys;
40 
44 
45 /********************************************************************/
49 UNIV_INLINE
52 /*========================*/
53  fil_addr_t node_addr);
55 /********************************************************************/
58 UNIV_INTERN
59 void
61 /*=================*/
62  ulint n_purge_threads,
63  ib_bh_t* ib_bh);
64 /********************************************************************/
66 UNIV_INTERN
67 void
69 /*======================*/
70 /************************************************************************
71 Adds the update undo log as the first log in the history list. Removes the
72 update undo log segment from the rseg slot if it is too big for reuse. */
73 UNIV_INTERN
74 void
76 /*=================================*/
77  trx_t* trx,
78  page_t* undo_page,
80  mtr_t* mtr);
81 /*******************************************************************/
84 UNIV_INTERN
85 ulint
86 trx_purge(
87 /*======*/
88  ulint n_purge_threads,
90  ulint limit,
92  bool truncate);
93 /*******************************************************************/
95 UNIV_INTERN
96 void
97 trx_purge_stop(void);
98 /*================*/
99 /*******************************************************************/
101 UNIV_INTERN
102 void
103 trx_purge_run(void);
104 /*================*/
105 
113 };
114 
115 /*******************************************************************/
118 UNIV_INTERN
120 trx_purge_state(void);
121 /*=================*/
122 
125 struct purge_iter_t {
131 };
132 
134 struct trx_purge_t{
149  ulint n_stop;
150  volatile bool running;
152  volatile purge_state_t state;
159  volatile ulint n_submitted;
161  volatile ulint n_completed;
163  /*------------------------------*/
164  /* The following two fields form the 'purge pointer' which advances
165  during a purge, and which is used in history list truncation */
166 
167  purge_iter_t iter; /* Limit up to which we have read and
168  parsed the UNDO log records. Not
169  necessarily purged from the indexes.
170  Note that this can never be less than
171  the limit below, we check for this
172  invariant in trx0purge.cc */
173  purge_iter_t limit; /* The 'purge pointer' which advances
174  during a purge, and which is used in
175  history list truncation */
176 #ifdef UNIV_DEBUG
177  purge_iter_t done; /* Indicate 'purge pointer' which have
178  purged already accurately. */
179 #endif /* UNIV_DEBUG */
180  /*-----------------------------*/
188  ulint page_no;
191  ulint offset;
194  ulint hdr_page_no;
196  ulint hdr_offset;
197  /*-----------------------------*/
201  /*-----------------------------*/
206 };
207 
212 };
213 
214 #ifndef UNIV_NONINL
215 #include "trx0purge.ic"
216 #endif
217 
218 #endif