InnoDB Plugin
1.0
Main Page
Data Structures
Files
File List
Globals
include
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
43
extern
trx_undo_rec_t
trx_purge_dummy_rec
;
44
45
/********************************************************************/
49
UNIV_INLINE
50
fil_addr_t
51
trx_purge_get_log_from_hist
(
52
/*========================*/
53
fil_addr_t
node_addr);
55
/********************************************************************/
58
UNIV_INTERN
59
void
60
trx_purge_sys_create
(
61
/*=================*/
62
ulint n_purge_threads,
63
ib_bh_t
* ib_bh);
64
/********************************************************************/
66
UNIV_INTERN
67
void
68
trx_purge_sys_close
(
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
75
trx_purge_add_update_undo_to_history
(
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
107
enum
purge_state_t
{
108
PURGE_STATE_INIT
,
109
PURGE_STATE_RUN
,
110
PURGE_STATE_STOP
,
111
PURGE_STATE_EXIT
,
112
PURGE_STATE_DISABLED
113
};
114
115
/*******************************************************************/
118
UNIV_INTERN
119
purge_state_t
120
trx_purge_state
(
void
);
121
/*=================*/
122
125
struct
purge_iter_t
{
126
trx_id_t
trx_no
;
129
undo_no_t
undo_no
;
131
};
132
134
struct
trx_purge_t
{
135
sess_t
*
sess
;
137
trx_t
*
trx
;
141
rw_lock_t
latch
;
148
os_event_t
event
;
149
ulint
n_stop
;
150
volatile
bool
running
;
152
volatile
purge_state_t
state
;
155
que_t
*
query
;
157
read_view_t
*
view
;
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
/*-----------------------------*/
181
ibool
next_stored
;
186
trx_rseg_t
*
rseg
;
188
ulint
page_no
;
191
ulint
offset
;
194
ulint
hdr_page_no
;
196
ulint
hdr_offset
;
197
/*-----------------------------*/
198
mem_heap_t
*
heap
;
201
/*-----------------------------*/
202
ib_bh_t
*
ib_bh
;
205
ib_mutex_t
bh_mutex
;
206
};
207
209
struct
trx_purge_rec_t
{
210
trx_undo_rec_t
*
undo_rec
;
211
roll_ptr_t
roll_ptr
;
212
};
213
214
#ifndef UNIV_NONINL
215
#include "
trx0purge.ic
"
216
#endif
217
218
#endif
Generated on Fri Aug 21 2015 19:14:24 for InnoDB Plugin by
1.8.1.2