22
22
/***********************************************************************
23
23
Reads the checkpoint info needed in hot backup. */
26
26
recv_read_cp_info_for_backup(
27
27
/*=========================*/
28
/* out: TRUE if success */
29
byte* hdr, /* in: buffer containing the log group header */
30
dulint* lsn, /* out: checkpoint lsn */
31
ulint* offset, /* out: checkpoint offset in the log group */
32
ulint* fsp_limit,/* out: fsp limit of space 0, 1000000000 if the
33
database is running with < version 3.23.50 of InnoDB */
34
dulint* cp_no, /* out: checkpoint number */
35
dulint* first_header_lsn);
36
/* out: lsn of of the start of the first log file */
28
/* out: TRUE if success */
29
byte* hdr, /* in: buffer containing the log group
31
ib_uint64_t* lsn, /* out: checkpoint lsn */
32
ulint* offset, /* out: checkpoint offset in the log group */
33
ulint* fsp_limit,/* out: fsp limit of space 0,
34
1000000000 if the database is running
35
with < version 3.23.50 of InnoDB */
36
ib_uint64_t* cp_no, /* out: checkpoint number */
37
ib_uint64_t* first_header_lsn);
38
/* out: lsn of of the start of the
37
40
/***********************************************************************
38
41
Scans the log segment and n_bytes_scanned is set to the length of valid
42
45
recv_scan_log_seg_for_backup(
43
46
/*=========================*/
44
47
byte* buf, /* in: buffer containing log data */
45
48
ulint buf_len, /* in: data length in that buffer */
46
dulint* scanned_lsn, /* in/out: lsn of buffer start,
49
ib_uint64_t* scanned_lsn, /* in/out: lsn of buffer start,
47
50
we return scanned lsn */
48
51
ulint* scanned_checkpoint_no,
49
52
/* in/out: 4 lowest bytes of the
68
71
Applies the hashed log records to the page, if the page lsn is less than the
69
72
lsn of a log record. This can be called when a buffer page has just been
70
73
read in, or also for a page already in the buffer pool. */
75
ibool recover_backup, /* in: TRUE if we are recovering a backup
79
/* in: TRUE if we are recovering a backup
76
80
page: then we do not acquire any latches
77
81
since the page was read in outside the
79
ibool just_read_in, /* in: TRUE if the i/o-handler calls this for
84
/* in: TRUE if the i/o-handler calls this for
80
85
a freshly read page */
81
page_t* page, /* in: buffer page */
82
ulint space, /* in: space id */
83
ulint page_no); /* in: page number */
86
buf_block_t* block); /* in: buffer block */
84
87
/************************************************************
85
88
Recovers from a checkpoint. When this function returns, the database is able
86
89
to start processing of new user transactions, but the function
87
90
recv_recovery_from_checkpoint_finish should be called later to complete
88
91
the recovery and free the resources used in it. */
91
94
recv_recovery_from_checkpoint_start(
92
95
/*================================*/
93
/* out: error code or DB_SUCCESS */
94
ulint type, /* in: LOG_CHECKPOINT or LOG_ARCHIVE */
95
dulint limit_lsn, /* in: recover up to this lsn if possible */
96
dulint min_flushed_lsn,/* in: min flushed lsn from data files */
97
dulint max_flushed_lsn);/* in: max flushed lsn from data files */
96
/* out: error code or DB_SUCCESS */
97
ulint type, /* in: LOG_CHECKPOINT or LOG_ARCHIVE */
98
ib_uint64_t limit_lsn, /* in: recover up to this lsn
100
ib_uint64_t min_flushed_lsn,/* in: min flushed lsn from
102
ib_uint64_t max_flushed_lsn);/* in: max flushed lsn from
98
104
/************************************************************
99
105
Completes recovery from a checkpoint. */
102
108
recv_recovery_from_checkpoint_finish(void);
103
109
/*======================================*/
104
110
/***********************************************************
105
111
Scans log from a buffer and stores new log data to the parsing buffer. Parses
106
112
and hashes the log records if new data found. */
109
115
recv_scan_log_recs(
110
116
/*===============*/
111
/* out: TRUE if limit_lsn has been reached, or
112
not able to scan any more in this log group */
113
ibool apply_automatically,/* in: TRUE if we want this function to
114
apply log records automatically when the
115
hash table becomes full; in the hot backup tool
116
the tool does the applying, not this
118
ulint available_memory,/* in: we let the hash table of recs to grow
119
to this size, at the maximum */
120
ibool store_to_hash, /* in: TRUE if the records should be stored
121
to the hash table; this is set to FALSE if just
122
debug checking is needed */
123
byte* buf, /* in: buffer containing a log segment or
125
ulint len, /* in: buffer length */
126
dulint start_lsn, /* in: buffer start lsn */
127
dulint* contiguous_lsn, /* in/out: it is known that all log groups
128
contain contiguous log data up to this lsn */
129
dulint* group_scanned_lsn);/* out: scanning succeeded up to this lsn */
117
/* out: TRUE if limit_lsn has been
118
reached, or not able to scan any more
120
ibool apply_automatically,/* in: TRUE if we want this
121
function to apply log records
122
automatically when the hash table
123
becomes full; in the hot backup tool
124
the tool does the applying, not this
126
ulint available_memory,/* in: we let the hash table of recs
127
to grow to this size, at the maximum */
128
ibool store_to_hash, /* in: TRUE if the records should be
129
stored to the hash table; this is set
130
to FALSE if just debug checking is
132
byte* buf, /* in: buffer containing a log segment
134
ulint len, /* in: buffer length */
135
ib_uint64_t start_lsn, /* in: buffer start lsn */
136
ib_uint64_t* contiguous_lsn, /* in/out: it is known that all log
137
groups contain contiguous log data up
139
ib_uint64_t* group_scanned_lsn);/* out: scanning succeeded up to
130
141
/**********************************************************
131
142
Resets the logs. The contents of log files will be lost! */
136
dulint lsn, /* in: reset to this lsn rounded up to
137
be divisible by OS_FILE_LOG_BLOCK_SIZE,
138
after which we add LOG_BLOCK_HDR_SIZE */
147
ib_uint64_t lsn, /* in: reset to this lsn
148
rounded up to be divisible by
149
OS_FILE_LOG_BLOCK_SIZE, after
151
LOG_BLOCK_HDR_SIZE */
139
152
#ifdef UNIV_LOG_ARCHIVE
140
ulint arch_log_no, /* in: next archived log file number */
153
ulint arch_log_no, /* in: next archived log file number */
141
154
#endif /* UNIV_LOG_ARCHIVE */
142
ibool new_logs_created);/* in: TRUE if resetting logs is done
143
at the log creation; FALSE if it is done
144
after archive recovery */
155
ibool new_logs_created);/* in: TRUE if resetting logs
156
is done at the log creation;
157
FALSE if it is done after
145
159
#ifdef UNIV_HOTBACKUP
146
160
/**********************************************************
147
161
Creates new log files after a backup has been restored. */
150
164
recv_reset_log_files_for_backup(
151
165
/*============================*/
152
166
const char* log_dir, /* in: log file directory path */
153
167
ulint n_log_files, /* in: number of log files */
154
168
ulint log_file_size, /* in: log file size */
155
dulint lsn); /* in: new start lsn, must be
169
ib_uint64_t lsn); /* in: new start lsn, must be
156
170
divisible by OS_FILE_LOG_BLOCK_SIZE */
157
171
#endif /* UNIV_HOTBACKUP */
158
172
/************************************************************
159
173
Creates the recovery system. */
162
176
recv_sys_create(void);
163
177
/*=================*/
164
178
/************************************************************
165
179
Inits the recovery system for a recovery operation. */
195
209
#ifdef UNIV_LOG_ARCHIVE
196
210
/************************************************************
197
211
Recovers from archived log files, and also from log files, if they exist. */
200
214
recv_recovery_from_archive_start(
201
215
/*=============================*/
202
/* out: error code or DB_SUCCESS */
203
dulint min_flushed_lsn,/* in: min flushed lsn field from the
205
dulint limit_lsn, /* in: recover up to this lsn if possible */
206
ulint first_log_no); /* in: number of the first archived log file
207
to use in the recovery; the file will be
208
searched from INNOBASE_LOG_ARCH_DIR specified
209
in server config file */
216
/* out: error code or DB_SUCCESS */
217
ib_uint64_t min_flushed_lsn,/* in: min flushed lsn field from the
219
ib_uint64_t limit_lsn, /* in: recover up to this lsn if
221
ulint first_log_no); /* in: number of the first archived
222
log file to use in the recovery; the
223
file will be searched from
224
INNOBASE_LOG_ARCH_DIR specified in
225
server config file */
210
226
/************************************************************
211
227
Completes recovery from archive. */
214
230
recv_recovery_from_archive_finish(void);
215
231
/*===================================*/