diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-01-16 11:13:08 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-01-16 11:13:08 +0100 |
commit | cf013ff949a5e05d678bdc3a37c56538fcab4a20 (patch) | |
tree | 9f2cd15d2d52deaf38321e2cc45a176370186ba0 /storage/xtradb/include | |
parent | 4ce53556ce5f31ec6b811c0803285cf0c29f4540 (diff) | |
parent | 37a5a54a01ab00fb334c89b6ed5e7dc6cef22fe5 (diff) | |
download | mariadb-git-cf013ff949a5e05d678bdc3a37c56538fcab4a20.tar.gz |
xtradb merge. Percona-Server-5.5.28-rel29.3
Diffstat (limited to 'storage/xtradb/include')
-rw-r--r-- | storage/xtradb/include/btr0btr.h | 5 | ||||
-rw-r--r-- | storage/xtradb/include/btr0cur.h | 5 | ||||
-rw-r--r-- | storage/xtradb/include/log0online.h | 104 | ||||
-rw-r--r-- | storage/xtradb/include/srv0srv.h | 7 | ||||
-rw-r--r-- | storage/xtradb/include/univ.i | 2 | ||||
-rw-r--r-- | storage/xtradb/include/ut0ut.h | 9 | ||||
-rw-r--r-- | storage/xtradb/include/ut0ut.ic | 13 |
7 files changed, 113 insertions, 32 deletions
diff --git a/storage/xtradb/include/btr0btr.h b/storage/xtradb/include/btr0btr.h index 03e89ae3f7d..fb06a774b82 100644 --- a/storage/xtradb/include/btr0btr.h +++ b/storage/xtradb/include/btr0btr.h @@ -65,7 +65,10 @@ enum btr_latch_mode { /** Search the previous record. */ BTR_SEARCH_PREV = 35, /** Modify the previous record. */ - BTR_MODIFY_PREV = 36 + BTR_MODIFY_PREV = 36, + /** Weaker BTR_MODIFY_TREE that does not lock the leaf page siblings, + used for fake changes. */ + BTR_SEARCH_TREE = 37 /* BTR_MODIFY_TREE | 4 */ }; /* BTR_INSERT, BTR_DELETE and BTR_DELETE_MARK are mutually exclusive. */ diff --git a/storage/xtradb/include/btr0cur.h b/storage/xtradb/include/btr0cur.h index cbc6103c2ee..cb44129aeb5 100644 --- a/storage/xtradb/include/btr0cur.h +++ b/storage/xtradb/include/btr0cur.h @@ -259,8 +259,9 @@ btr_cur_update_alloc_zip( ulint length, /*!< in: size needed */ ibool create, /*!< in: TRUE=delete-and-insert, FALSE=update-in-place */ - mtr_t* mtr) /*!< in: mini-transaction */ - __attribute__((nonnull, warn_unused_result)); + mtr_t* mtr, /*!< in: mini-transaction */ + trx_t* trx) /*!< in: NULL or transaction */ + __attribute__((nonnull (1, 2, 3, 6), warn_unused_result)); /*************************************************************//** Updates a record when the update causes no size changes in its fields. @return DB_SUCCESS or error number */ diff --git a/storage/xtradb/include/log0online.h b/storage/xtradb/include/log0online.h index 0e0ca169f6f..e7c3f301e45 100644 --- a/storage/xtradb/include/log0online.h +++ b/storage/xtradb/include/log0online.h @@ -27,6 +27,16 @@ Online database log parsing for changed page tracking #include "univ.i" #include "os0file.h" +/** Single bitmap file information */ +typedef struct log_online_bitmap_file_struct log_online_bitmap_file_t; + +/** A set of bitmap files containing some LSN range */ +typedef struct log_online_bitmap_file_range_struct +log_online_bitmap_file_range_t; + +/** An iterator over changed page info */ +typedef struct log_bitmap_iterator_struct log_bitmap_iterator_t; + /*********************************************************************//** Initializes the online log following subsytem. */ UNIV_INTERN @@ -49,45 +59,32 @@ void log_online_follow_redo_log(); /*=========================*/ -/** The iterator through all bits of changed pages bitmap blocks */ -struct log_bitmap_iterator_struct -{ - char in_name[FN_REFLEN]; /*!< the file name for bitmap - input */ - os_file_t in; /*!< the bitmap input file */ - ib_uint64_t in_offset; /*!< the next write position in the - bitmap output file */ - ib_uint32_t bit_offset; /*!< bit offset inside of bitmap - block*/ - ib_uint64_t start_lsn; /*!< Start lsn of the block */ - ib_uint64_t end_lsn; /*!< End lsn of the block */ - ib_uint32_t space_id; /*!< Block space id */ - ib_uint32_t first_page_id; /*!< First block page id */ - ibool changed; /*!< true if current page was changed */ - byte* page; /*!< Bitmap block */ -}; - -typedef struct log_bitmap_iterator_struct log_bitmap_iterator_t; - #define LOG_BITMAP_ITERATOR_START_LSN(i) \ - ((i).start_lsn) + ((i).start_lsn) #define LOG_BITMAP_ITERATOR_END_LSN(i) \ - ((i).end_lsn) + ((i).end_lsn) #define LOG_BITMAP_ITERATOR_SPACE_ID(i) \ - ((i).space_id) + ((i).space_id) #define LOG_BITMAP_ITERATOR_PAGE_NUM(i) \ - ((i).first_page_id + (i).bit_offset) + ((i).first_page_id + (i).bit_offset) #define LOG_BITMAP_ITERATOR_PAGE_CHANGED(i) \ - ((i).changed) + ((i).changed) /*********************************************************************//** -Initializes log bitmap iterator. +Initializes log bitmap iterator. The minimum LSN is used for finding the +correct starting file with records and it there may be records returned by +the iterator that have LSN less than start_lsn. + @return TRUE if the iterator is initialized OK, FALSE otherwise. */ UNIV_INTERN ibool log_online_bitmap_iterator_init( /*============================*/ - log_bitmap_iterator_t *i); /*!<in/out: iterator */ + log_bitmap_iterator_t *i, /*!<in/out: iterator */ + ib_uint64_t min_lsn, /*!<in: start LSN for the + iterator */ + ib_uint64_t max_lsn); /*!<in: end LSN for the + iterator */ /*********************************************************************//** Releases log bitmap iterator. */ @@ -108,4 +105,57 @@ log_online_bitmap_iterator_next( /*============================*/ log_bitmap_iterator_t *i); /*!<in/out: iterator */ +/** Struct for single bitmap file information */ +struct log_online_bitmap_file_struct { + char name[FN_REFLEN]; /*!< Name with full path */ + os_file_t file; /*!< Handle to opened file */ + ib_uint64_t size; /*!< Size of the file */ + ib_uint64_t offset; /*!< Offset of the next read, + or count of already-read bytes + */ +}; + +/** Struct for a set of bitmap files containing some LSN range */ +struct log_online_bitmap_file_range_struct { + size_t count; /*!< Number of files */ + /*!< Dynamically-allocated array of info about individual files */ + struct { + char name[FN_REFLEN]; /*!< Name of a file */ + ib_uint64_t start_lsn; /*!< Starting LSN of + data in this file */ + ulong seq_num; /*!< Sequence number of + this file */ + } *files; +}; + +/** Struct for an iterator through all bits of changed pages bitmap blocks */ +struct log_bitmap_iterator_struct +{ + log_online_bitmap_file_range_t in_files; /*!< The bitmap files + for this iterator */ + size_t in_i; /*!< Currently read + file index in in_files + */ + log_online_bitmap_file_t in; /*!< Currently read + file */ + ib_uint32_t bit_offset; /*!< bit offset inside + the current bitmap + block */ + ib_uint64_t start_lsn; /*!< Start LSN of the + current bitmap block */ + ib_uint64_t end_lsn; /*!< End LSN of the + current bitmap block */ + ib_uint32_t space_id; /*!< Current block + space id */ + ib_uint32_t first_page_id; /*!< Id of the first + page in the current + block */ + ibool last_page_in_run;/*!< "Last page in + run" flag value for the + current block */ + ibool changed; /*!< true if current + page was changed */ + byte* page; /*!< Bitmap block */ +}; + #endif diff --git a/storage/xtradb/include/srv0srv.h b/storage/xtradb/include/srv0srv.h index a95eb8a1d58..6c5b61487f2 100644 --- a/storage/xtradb/include/srv0srv.h +++ b/storage/xtradb/include/srv0srv.h @@ -144,7 +144,8 @@ extern char* srv_doublewrite_file; extern ibool srv_recovery_stats; -extern my_bool srv_track_changed_pages; +extern my_bool srv_track_changed_pages; +extern ib_uint64_t srv_max_bitmap_file_size; extern ulonglong srv_changed_pages_limit; @@ -395,6 +396,10 @@ extern uint srv_auto_lru_dump; /** Whether startup should be blocked until buffer pool is fully restored */ extern ibool srv_blocking_lru_restore; +/** When TRUE, fake change transcations take S rather than X row locks. +When FALSE, row locks are not taken at all. */ +extern my_bool srv_fake_changes_locks; + /** Status variables to be passed to MySQL */ typedef struct export_var_struct export_struc; diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index 5d2cd2d0313..77acf54d8dc 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -54,7 +54,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_BUGFIX 8 #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 29.1 +#define PERCONA_INNODB_VERSION 29.3 #endif /* The following is the InnoDB version as shown in diff --git a/storage/xtradb/include/ut0ut.h b/storage/xtradb/include/ut0ut.h index 47ab6eb9b74..48f30b33e65 100644 --- a/storage/xtradb/include/ut0ut.h +++ b/storage/xtradb/include/ut0ut.h @@ -122,6 +122,15 @@ ut_max( /*===*/ ulint n1, /*!< in: first number */ ulint n2); /*!< in: second number */ +/******************************************************//** +Calculates the maximum of two ib_uint64_t values. +@return the maximum */ +UNIV_INLINE +ib_uint64_t +ut_max_uint64( +/*==========*/ + ib_uint64_t n1, /*!< in: first number */ + ib_uint64_t n2); /*!< in: second number */ /****************************************************************//** Calculates minimum of two ulint-pairs. */ UNIV_INLINE diff --git a/storage/xtradb/include/ut0ut.ic b/storage/xtradb/include/ut0ut.ic index 6f55c7e410e..d56deb6266f 100644 --- a/storage/xtradb/include/ut0ut.ic +++ b/storage/xtradb/include/ut0ut.ic @@ -49,6 +49,19 @@ ut_max( return((n1 <= n2) ? n2 : n1); } +/******************************************************//** +Calculates the maximum of two ib_uint64_t values. +@return the maximum */ +UNIV_INLINE +ib_uint64_t +ut_max_uint64( +/*==========*/ + ib_uint64_t n1, /*!< in: first number */ + ib_uint64_t n2) /*!< in: second number */ +{ + return((n1 <= n2) ? n2 : n1); +} + /****************************************************************//** Calculates minimum of two ulint-pairs. */ UNIV_INLINE |