drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
log0recv.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (C) 1997, 2010, Innobase Oy. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/**************************************************/
25
26#pragma once
27#ifndef log0recv_h
28#define log0recv_h
29
30#include "univ.i"
31#include "ut0byte.h"
32#include "buf0types.h"
33#include "hash0hash.h"
34#include "log0log.h"
35
36#ifdef UNIV_HOTBACKUP
37extern ibool recv_replay_file_ops;
38
39/*******************************************************************/
42UNIV_INTERN
43ibool
44recv_read_cp_info_for_backup(
45/*=========================*/
46 const byte* hdr,
48 ib_uint64_t* lsn,
49 ulint* offset,
50 ulint* fsp_limit,
53 ib_uint64_t* cp_no,
54 ib_uint64_t* first_header_lsn);
57/*******************************************************************/
60UNIV_INTERN
61void
62recv_scan_log_seg_for_backup(
63/*=========================*/
64 byte* buf,
65 ulint buf_len,
66 ib_uint64_t* scanned_lsn,
68 ulint* scanned_checkpoint_no,
72 ulint* n_bytes_scanned);
75#endif /* UNIV_HOTBACKUP */
76/*******************************************************************/
79UNIV_INLINE
80ibool
82/*=====================*/
83#ifdef UNIV_LOG_ARCHIVE
84/*******************************************************************/
87UNIV_INLINE
88ibool
89recv_recovery_from_backup_is_on(void);
90/*=================================*/
91#endif /* UNIV_LOG_ARCHIVE */
92/************************************************************************/
96UNIV_INTERN
97void
99/*===================*/
100#ifndef UNIV_HOTBACKUP
101 ibool just_read_in,
104#endif /* !UNIV_HOTBACKUP */
105 buf_block_t* block);
106#ifndef UNIV_HOTBACKUP
115# define recv_recover_page(jri, block) recv_recover_page_func(jri, block)
116#else /* !UNIV_HOTBACKUP */
125# define recv_recover_page(jri, block) recv_recover_page_func(block)
126#endif /* !UNIV_HOTBACKUP */
127/********************************************************/
133UNIV_INTERN
134ulint
136/*=====================================*/
137#ifdef UNIV_LOG_ARCHIVE
138 ulint type,
140 ib_uint64_t limit_lsn,
142#endif /* UNIV_LOG_ARCHIVE */
143 ib_uint64_t min_flushed_lsn,
145 ib_uint64_t max_flushed_lsn);
147#ifdef UNIV_LOG_ARCHIVE
158# define recv_recovery_from_checkpoint_start(type,lim,min,max) \
159 recv_recovery_from_checkpoint_start_func(type,lim,min,max)
160#else /* UNIV_LOG_ARCHIVE */
171# define recv_recovery_from_checkpoint_start(type,lim,min,max) \
172 recv_recovery_from_checkpoint_start_func(min,max)
173#endif /* UNIV_LOG_ARCHIVE */
174/********************************************************/
176UNIV_INTERN
177void
179/*======================================*/
180/********************************************************/
182UNIV_INTERN
183void
185/*===============================*/
186/*******************************************************/
193UNIV_INTERN
194ibool
196/*===============*/
197 ulint available_memory,
199 ibool store_to_hash,
203 const byte* buf,
205 ulint len,
206 ib_uint64_t start_lsn,
207 ib_uint64_t* contiguous_lsn,
210 ib_uint64_t* group_scanned_lsn);
212/******************************************************/
214UNIV_INTERN
215void
217/*============*/
218 ib_uint64_t lsn,
223#ifdef UNIV_LOG_ARCHIVE
224 ulint arch_log_no,
225#endif /* UNIV_LOG_ARCHIVE */
226 ibool new_logs_created);
230#ifdef UNIV_HOTBACKUP
231/******************************************************/
233UNIV_INTERN
234void
235recv_reset_log_files_for_backup(
236/*============================*/
237 const char* log_dir,
238 ulint n_log_files,
239 ulint log_file_size,
240 ib_uint64_t lsn);
242#endif /* UNIV_HOTBACKUP */
243/********************************************************/
245UNIV_INTERN
246void
247recv_sys_create(void);
248/*=================*/
249/**********************************************************/
251UNIV_INTERN
252void
253recv_sys_close(void);
254/*================*/
255/********************************************************/
257UNIV_INTERN
258void
260/*===================*/
261/********************************************************/
263UNIV_INTERN
264void
266/*==========*/
267 ulint available_memory);
268#ifndef UNIV_HOTBACKUP
269/********************************************************/
271UNIV_INTERN
272void
274/*===================*/
275#endif /* !UNIV_HOTBACKUP */
276/*******************************************************************/
279UNIV_INTERN
280void
282/*=======================*/
283 ibool allow_ibuf);
290#ifdef UNIV_HOTBACKUP
291/*******************************************************************/
293UNIV_INTERN
294void
295recv_apply_log_recs_for_backup(void);
296/*================================*/
297#endif
298#ifdef UNIV_LOG_ARCHIVE
299/********************************************************/
302UNIV_INTERN
303ulint
304recv_recovery_from_archive_start(
305/*=============================*/
306 ib_uint64_t min_flushed_lsn,
308 ib_uint64_t limit_lsn,
310 ulint first_log_no);
315/********************************************************/
317UNIV_INTERN
318void
319recv_recovery_from_archive_finish(void);
320/*===================================*/
321#endif /* UNIV_LOG_ARCHIVE */
322
332
334typedef struct recv_struct recv_t;
337 byte type;
338 ulint len;
341 ib_uint64_t start_lsn;
345 ib_uint64_t end_lsn;
351};
352
365
378
383#ifndef UNIV_HOTBACKUP
387#endif /* !UNIV_HOTBACKUP */
396 ib_uint64_t lsn;
406 byte* buf;
407 ulint len;
408 ib_uint64_t parse_start_lsn;
413 ib_uint64_t scanned_lsn;
422 ib_uint64_t recovered_lsn;
425 ib_uint64_t limit_lsn;
432#ifdef UNIV_LOG_ARCHIVE
433 log_group_t* archive_group;
436#endif /* !UNIV_LOG_ARCHIVE */
437 mem_heap_t* heap;
439 hash_table_t* addr_hash;
440 ulint n_addrs;
442};
443
445extern recv_sys_t* recv_sys;
446
450extern ibool recv_recovery_on;
460extern ibool recv_no_ibuf_operations;
462extern ibool recv_needed_recovery;
463#ifdef UNIV_DEBUG
466extern ibool recv_no_log_write;
467#endif /* UNIV_DEBUG */
468
472extern ibool recv_lsn_checks_on;
473#ifdef UNIV_HOTBACKUP
475extern ibool recv_is_making_a_backup;
476#endif /* UNIV_HOTBACKUP */
478extern ulint recv_max_parsed_page_no;
479
482#define RECV_PARSING_BUF_SIZE (2 * 1024 * 1024)
483
486#define RECV_SCAN_SIZE (4 * UNIV_PAGE_SIZE)
487
492extern ulint recv_n_pool_free_frames;
493
494#ifndef UNIV_NONINL
495#include "log0recv.ic"
496#endif
497
498#endif
struct buf_block_struct buf_block_t
Definition buf0types.h:33
struct log_group_struct log_group_t
Definition log0log.h:48
UNIV_INTERN void recv_recovery_rollback_active(void)
Definition log0recv.cc:3299
UNIV_INTERN void recv_reset_logs(ib_uint64_t lsn, ibool new_logs_created)
Definition log0recv.cc:3330
struct recv_addr_struct recv_addr_t
Definition log0recv.h:367
ibool recv_needed_recovery
Definition log0recv.cc:85
UNIV_INTERN ulint recv_recovery_from_checkpoint_start_func(ib_uint64_t min_flushed_lsn, ib_uint64_t max_flushed_lsn)
Definition log0recv.cc:2882
struct recv_struct recv_t
Definition log0recv.h:334
recv_addr_state
Definition log0recv.h:354
@ RECV_BEING_READ
Definition log0recv.h:358
@ RECV_BEING_PROCESSED
Definition log0recv.h:360
@ RECV_NOT_PROCESSED
Definition log0recv.h:356
@ RECV_PROCESSED
Definition log0recv.h:363
UNIV_INTERN void recv_sys_mem_free(void)
Definition log0recv.cc:232
struct recv_data_struct recv_data_t
Definition log0recv.h:324
struct recv_sys_struct recv_sys_t
Definition log0recv.h:380
UNIV_INTERN void recv_sys_close(void)
Definition log0recv.cc:201
UNIV_INTERN void recv_apply_hashed_log_recs(ibool allow_ibuf)
Definition log0recv.cc:1738
UNIV_INTERN void recv_recover_page_func(ibool just_read_in, buf_block_t *block)
Definition log0recv.cc:1468
recv_sys_t * recv_sys
Definition log0recv.cc:73
ulint recv_max_parsed_page_no
Definition log0recv.cc:141
UNIV_INTERN void recv_sys_var_init(void)
Definition log0recv.cc:262
UNIV_INTERN void recv_sys_create(void)
Definition log0recv.cc:180
UNIV_INTERN ibool recv_scan_log_recs(ulint available_memory, ibool store_to_hash, const byte *buf, ulint len, ib_uint64_t start_lsn, ib_uint64_t *contiguous_lsn, ib_uint64_t *group_scanned_lsn)
Definition log0recv.cc:2562
ibool recv_no_ibuf_operations
Definition log0recv.cc:116
ibool recv_lsn_checks_on
Definition log0recv.cc:95
ulint recv_n_pool_free_frames
Definition log0recv.cc:149
UNIV_INTERN void recv_recovery_from_checkpoint_finish(void)
Definition log0recv.cc:3255
ibool recv_recovery_on
Definition log0recv.cc:77
UNIV_INTERN void recv_sys_init(ulint available_memory)
Definition log0recv.cc:303
UNIV_INLINE ibool recv_recovery_is_on(void)
hash_node_t addr_hash
Definition log0recv.h:376
unsigned space
Definition log0recv.h:372
unsigned page_no
Definition log0recv.h:373
enum recv_addr_state state
Definition log0recv.h:370
recv_data_t * next
Definition log0recv.h:327
recv_data_t * data
Definition log0recv.h:339
ulint len
Definition log0recv.h:338
ib_uint64_t start_lsn
Definition log0recv.h:341
ib_uint64_t end_lsn
Definition log0recv.h:345
ibool apply_batch_on
Definition log0recv.h:393
ibool apply_log_recs
Definition log0recv.h:388
ibool found_corrupt_log
Definition log0recv.h:427
ib_uint64_t parse_start_lsn
Definition log0recv.h:408
ib_uint64_t recovered_lsn
Definition log0recv.h:422
ulint scanned_checkpoint_no
Definition log0recv.h:416
ib_uint64_t lsn
Definition log0recv.h:396
byte * last_block
Definition log0recv.h:400
mem_heap_t * heap
Definition log0recv.h:437
ib_uint64_t scanned_lsn
Definition log0recv.h:413
ulint recovered_offset
Definition log0recv.h:419
mutex_t mutex
Definition log0recv.h:384
ib_uint64_t limit_lsn
Definition log0recv.h:425
ulint last_log_buf_size
Definition log0recv.h:397
hash_table_t * addr_hash
Definition log0recv.h:439
byte * last_block_buf_start
Definition log0recv.h:403
#define mutex_t
Definition sync0types.h:31
#define UT_LIST_NODE_T(TYPE)
Definition ut0lst.h:73
#define UT_LIST_BASE_NODE_T(TYPE)
Definition ut0lst.h:54