summaryrefslogtreecommitdiff
path: root/innobase/include/log0recv.h
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-03-27 01:56:10 +0200
committerunknown <monty@hundin.mysql.fi>2002-03-27 01:56:10 +0200
commit36b38aa503c05efd0479d73dbb40e5e8f13cb986 (patch)
tree6998f99b1790b678ac1558e748e2a8c992bbfa22 /innobase/include/log0recv.h
parent6229932f1010c270e2319d8dc3be9670d016546e (diff)
parentbbedc5ebbf8951c3b6a3d4047c40e7934774d58a (diff)
downloadmariadb-git-36b38aa503c05efd0479d73dbb40e5e8f13cb986.tar.gz
merge with 3.23.50
BitKeeper/etc/logging_ok: auto-union BUILD/SETUP.sh: Auto merged Build-tools/Do-compile: Auto merged Build-tools/Do-rpm: Auto merged configure.in: Auto merged include/mysql_com.h: Auto merged innobase/btr/btr0btr.c: Auto merged innobase/btr/btr0cur.c: Auto merged innobase/btr/btr0sea.c: Auto merged innobase/dict/dict0dict.c: Auto merged innobase/dict/dict0load.c: Auto merged innobase/fil/fil0fil.c: Auto merged innobase/fsp/fsp0fsp.c: Auto merged innobase/include/srv0srv.h: Auto merged innobase/include/sync0rw.ic: Auto merged innobase/log/log0log.c: Auto merged innobase/rem/rem0cmp.c: Auto merged innobase/row/row0ins.c: Auto merged innobase/row/row0sel.c: Auto merged innobase/row/row0upd.c: Auto merged innobase/srv/srv0srv.c: Auto merged innobase/srv/srv0start.c: Auto merged myisam/myisampack.c: Auto merged mysql-test/t/range.test: Auto merged scripts/mysqldumpslow.sh: Auto merged sql/ha_innodb.h: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/lock.cc: Auto merged sql/share/Makefile.am: Auto merged sql/sql_rename.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged support-files/mysql.spec.sh: Auto merged Docs/manual.texi: merge client/mysql.cc: merge client/mysqldump.c: merge innobase/buf/buf0buf.c: merge innobase/os/os0file.c: merge innobase/row/row0mysql.c: merge mysql-test/r/range.result: merge sql/ha_innodb.cc: merge sql/log_event.h: merge sql/mysqld.cc: merge sql/sql_base.cc: merge sql/sql_load.cc: merge
Diffstat (limited to 'innobase/include/log0recv.h')
-rw-r--r--innobase/include/log0recv.h82
1 files changed, 79 insertions, 3 deletions
diff --git a/innobase/include/log0recv.h b/innobase/include/log0recv.h
index 8f896756db9..0825325965d 100644
--- a/innobase/include/log0recv.h
+++ b/innobase/include/log0recv.h
@@ -16,6 +16,39 @@ Created 9/20/1997 Heikki Tuuri
#include "log0log.h"
/***********************************************************************
+Reads the checkpoint info needed in hot backup. */
+
+ibool
+recv_read_cp_info_for_backup(
+/*=========================*/
+ /* out: TRUE if success */
+ byte* hdr, /* in: buffer containing the log group header */
+ dulint* lsn, /* out: checkpoint lsn */
+ ulint* offset, /* out: checkpoint offset in the log group */
+ ulint* fsp_limit,/* out: fsp limit, 1000000000 if the database
+ is running with < version 3.23.50 of InnoDB */
+ dulint* cp_no, /* out: checkpoint number */
+ dulint* first_header_lsn);
+ /* out: lsn of of the start of the first log file */
+/***********************************************************************
+Scans the log segment and n_bytes_scanned is set to the length of valid
+log scanned. */
+
+void
+recv_scan_log_seg_for_backup(
+/*=========================*/
+ byte* buf, /* in: buffer containing log data */
+ ulint buf_len, /* in: data length in that buffer */
+ dulint* scanned_lsn, /* in/out: lsn of buffer start,
+ we return scanned lsn */
+ ulint* scanned_checkpoint_no,
+ /* in/out: 4 lowest bytes of the
+ highest scanned checkpoint number so
+ far */
+ ulint* n_bytes_scanned);/* out: how much we were able to
+ scan, smaller than buf_len if log
+ data ended here */
+/***********************************************************************
Returns TRUE if recovery is currently running. */
UNIV_INLINE
ibool
@@ -35,6 +68,10 @@ read in, or also for a page already in the buffer pool. */
void
recv_recover_page(
/*==============*/
+ ibool recover_backup, /* in: TRUE if we are recovering a backup
+ page: then we do not acquire any latches
+ since the page was read in outside the
+ buffer pool */
ibool just_read_in, /* in: TRUE if the i/o-handler calls this for
a freshly read page */
page_t* page, /* in: buffer page */
@@ -69,8 +106,15 @@ recv_scan_log_recs(
/*===============*/
/* out: TRUE if limit_lsn has been reached, or
not able to scan any more in this log group */
+ ibool apply_automatically,/* in: TRUE if we want this function to
+ apply log records automatically when the
+ hash table becomes full; in the hot backup tool
+ the tool does the applying, not this
+ function */
+ ulint available_memory,/* in: we let the hash table of recs to grow
+ to this size, at the maximum */
ibool store_to_hash, /* in: TRUE if the records should be stored
- to the hash table; this is set FALSE if just
+ to the hash table; this is set to FALSE if just
debug checking is needed */
byte* buf, /* in: buffer containing a log segment or
garbage */
@@ -92,6 +136,16 @@ recv_reset_logs(
ibool new_logs_created);/* in: TRUE if resetting logs is done
at the log creation; FALSE if it is done
after archive recovery */
+/**********************************************************
+Creates new log files after a backup has been restored. */
+
+void
+recv_reset_log_files_for_backup(
+/*============================*/
+ char* log_dir, /* in: log file directory path */
+ ulint n_log_files, /* in: number of log files */
+ ulint log_file_size, /* in: log file size */
+ dulint lsn); /* in: new start lsn */
/************************************************************
Creates the recovery system. */
@@ -102,8 +156,11 @@ recv_sys_create(void);
Inits the recovery system for a recovery operation. */
void
-recv_sys_init(void);
-/*===============*/
+recv_sys_init(
+/*==========*/
+ ibool recover_from_backup, /* in: TRUE if this is called
+ to recover from a hot backup */
+ ulint available_memory); /* in: available memory in bytes */
/***********************************************************************
Empties the hash table of stored log records, applying them to appropriate
pages. */
@@ -118,6 +175,17 @@ recv_apply_hashed_log_recs(
disk and invalidated in buffer pool: this
alternative means that no new log records
can be generated during the application */
+/***********************************************************************
+Applies log records in the hash table to a backup. */
+
+void
+recv_apply_log_recs_for_backup(
+/*===========================*/
+ ulint n_data_files, /* in: number of data files */
+ char** data_files, /* in: array containing the paths to the
+ data files */
+ ulint* file_sizes); /* in: sizes of the data files in database
+ pages */
/************************************************************
Recovers from archived log files, and also from log files, if they exist. */
@@ -260,6 +328,14 @@ extern ibool recv_recovery_on;
extern ibool recv_no_ibuf_operations;
extern ibool recv_needed_recovery;
+/* Size of the parsing buffer; it must accommodate RECV_SCAN_SIZE many
+times! */
+#define RECV_PARSING_BUF_SIZE (2 * 1024 * 1024)
+
+/* Size of block reads when the log groups are scanned forward to do a
+roll-forward */
+#define RECV_SCAN_SIZE (4 * UNIV_PAGE_SIZE)
+
/* States of recv_addr_struct */
#define RECV_NOT_PROCESSED 71
#define RECV_BEING_READ 72