summaryrefslogtreecommitdiff
path: root/innobase/include/log0log.h
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2002-06-22 20:41:14 +0300
committerunknown <heikki@hundin.mysql.fi>2002-06-22 20:41:14 +0300
commit1081513a12851d432103eaabcb6533c84062196c (patch)
treecd94be28879d52101bd7438dc97dc04856d81739 /innobase/include/log0log.h
parentb7b988b3c36fa7a1f0a284d6478bbccbe706c09f (diff)
downloadmariadb-git-1081513a12851d432103eaabcb6533c84062196c.tar.gz
Many files:
Merge 3.23.52 innobase/btr/btr0btr.c: Merge 3.23.52 innobase/btr/btr0cur.c: Merge 3.23.52 innobase/btr/btr0sea.c: Merge 3.23.52 innobase/include/btr0btr.h: Merge 3.23.52 innobase/include/btr0cur.h: Merge 3.23.52 innobase/include/btr0sea.h: Merge 3.23.52 innobase/include/buf0buf.h: Merge 3.23.52 innobase/include/buf0rea.h: Merge 3.23.52 innobase/include/data0data.h: Merge 3.23.52 innobase/include/data0data.ic: Merge 3.23.52 innobase/include/log0log.h: Merge 3.23.52 innobase/include/log0log.ic: Merge 3.23.52 innobase/include/os0file.h: Merge 3.23.52 innobase/include/page0page.h: Merge 3.23.52 innobase/include/page0page.ic: Merge 3.23.52 innobase/include/row0mysql.h: Merge 3.23.52 innobase/include/trx0roll.h: Merge 3.23.52 innobase/include/trx0sys.h: Merge 3.23.52 innobase/include/trx0trx.h: Merge 3.23.52 innobase/include/ut0ut.h: Merge 3.23.52 innobase/include/univ.i: Merge 3.23.52 innobase/include/ut0ut.ic: Merge 3.23.52 innobase/buf/buf0buf.c: Merge 3.23.52 innobase/buf/buf0rea.c: Merge 3.23.52 innobase/data/data0data.c: Merge 3.23.52 innobase/dict/dict0crea.c: Merge 3.23.52 innobase/dict/dict0dict.c: Merge 3.23.52 innobase/dict/dict0load.c: Merge 3.23.52 innobase/dict/dict0mem.c: Merge 3.23.52 innobase/fsp/fsp0fsp.c: Merge 3.23.52 innobase/ibuf/ibuf0ibuf.c: Merge 3.23.52 innobase/lock/lock0lock.c: Merge 3.23.52 innobase/log/log0log.c: Merge 3.23.52 innobase/log/log0recv.c: Merge 3.23.52 innobase/mtr/mtr0log.c: Merge 3.23.52 innobase/mtr/mtr0mtr.c: Merge 3.23.52 innobase/os/os0file.c: Merge 3.23.52 innobase/page/page0cur.c: Merge 3.23.52 innobase/page/page0page.c: Merge 3.23.52 innobase/rem/rem0cmp.c: Merge 3.23.52 innobase/row/row0ins.c: Merge 3.23.52 innobase/row/row0mysql.c: Merge 3.23.52 innobase/row/row0purge.c: Merge 3.23.52 innobase/row/row0upd.c: Merge 3.23.52 innobase/srv/srv0srv.c: Merge 3.23.52 innobase/srv/srv0start.c: Merge 3.23.52 innobase/trx/trx0roll.c: Merge 3.23.52 innobase/trx/trx0sys.c: Merge 3.23.52 innobase/trx/trx0trx.c: Merge 3.23.52 innobase/trx/trx0undo.c: Merge 3.23.52 innobase/ut/ut0mem.c: Merge 3.23.52 innobase/ut/ut0ut.c: Merge 3.23.52
Diffstat (limited to 'innobase/include/log0log.h')
-rw-r--r--innobase/include/log0log.h50
1 files changed, 45 insertions, 5 deletions
diff --git a/innobase/include/log0log.h b/innobase/include/log0log.h
index eeb4f2e45f1..d4bd0036c5a 100644
--- a/innobase/include/log0log.h
+++ b/innobase/include/log0log.h
@@ -157,6 +157,14 @@ log_io_complete(
/*============*/
log_group_t* group); /* in: log group */
/**********************************************************
+Flushes the log files to the disk, using, for example, the Unix fsync.
+This function does the flush even if the user has set
+srv_flush_log_at_trx_commit = FALSE. */
+
+void
+log_flush_to_disk(void);
+/*===================*/
+/**********************************************************
This function is called, e.g., when a transaction wants to commit. It checks
that the log has been flushed to disk up to the last log entry written by the
transaction. If there is a flush running, it waits and checks if the flush
@@ -260,7 +268,9 @@ log_reset_first_header_and_checkpoint(
/*==================================*/
byte* hdr_buf,/* in: buffer which will be written to the start
of the first log file */
- dulint lsn); /* in: lsn of the start of the first log file */
+ dulint start); /* in: lsn of the start of the first log file;
+ we pretend that there is a checkpoint at
+ start + LOG_BLOCK_HDR_SIZE */
/************************************************************************
Starts an archiving operation. */
@@ -463,6 +473,15 @@ log_block_init(
byte* log_block, /* in: pointer to the log buffer */
dulint lsn); /* in: lsn within the log block */
/****************************************************************
+Initializes a log block in the log buffer in the old, < 3.23.52 format, where
+there was no checksum yet. */
+UNIV_INLINE
+void
+log_block_init_in_old_format(
+/*=========================*/
+ byte* log_block, /* in: pointer to the log buffer */
+ dulint lsn); /* in: lsn within the log block */
+/****************************************************************
Converts a lsn to a log block number. */
UNIV_INLINE
ulint
@@ -523,7 +542,10 @@ extern log_t* log_sys;
bytes */
/* Offsets of a log block trailer from the end of the block */
-#define LOG_BLOCK_TRL_NO 4 /* log block number */
+#define LOG_BLOCK_TRL_CHECKSUM 4 /* 1 byte checksum of the log block
+ contents */
+#define LOG_BLOCK_TRL_NO 3 /* 3 lowest bytes of the log block
+ number */
#define LOG_BLOCK_TRL_SIZE 4 /* trailer size in bytes */
/* Offsets for a checkpoint field */
@@ -558,11 +580,22 @@ extern log_t* log_sys;
#define LOG_GROUP_ID 0 /* log group number */
#define LOG_FILE_START_LSN 4 /* lsn of the start of data in this
log file */
-#define LOG_FILE_NO 12 /* 4-byte archived log file number */
+#define LOG_FILE_NO 12 /* 4-byte archived log file number;
+ this field is only defined in an
+ archived log file */
+#define LOG_FILE_WAS_CREATED_BY_HOT_BACKUP 16
+ /* a 32-byte field which contains
+ the string 'ibbackup' and the
+ creation time if the log file was
+ created by ibbackup --restore;
+ when mysqld is first time started
+ on the restored database, it can
+ print helpful info for the user */
#define LOG_FILE_ARCH_COMPLETED OS_FILE_LOG_BLOCK_SIZE
/* this 4-byte field is TRUE when
the writing of an archived log file
- has been completed */
+ has been completed; this field is
+ only defined in an archived log file */
#define LOG_FILE_END_LSN (OS_FILE_LOG_BLOCK_SIZE + 4)
/* lsn where the archived log file
at least extends: actually the
@@ -572,7 +605,14 @@ extern log_t* log_sys;
is defined only when an archived log
file has been completely written */
#define LOG_CHECKPOINT_1 OS_FILE_LOG_BLOCK_SIZE
+ /* first checkpoint field in the log
+ header; we write alternately to the
+ checkpoint fields when we make new
+ checkpoints; this field is only defined
+ in the first log file of a log group */
#define LOG_CHECKPOINT_2 (3 * OS_FILE_LOG_BLOCK_SIZE)
+ /* second checkpoint field in the log
+ header */
#define LOG_FILE_HDR_SIZE (4 * OS_FILE_LOG_BLOCK_SIZE)
#define LOG_GROUP_OK 301
@@ -678,7 +718,7 @@ struct log_struct{
write i/o has been completed for all
log groups */
dulint flush_lsn; /* end lsn for the current flush */
- ulint flush_end_offset;/* the data in buffer ha been flushed
+ ulint flush_end_offset;/* the data in buffer has been flushed
up to this offset when the current
flush ends: this field will then
be copied to buf_next_to_write */