3653 Marko Mäkelä 2010-11-03
Bug#57947 InnoDB diagnostics shows btr_block_get calls instead of real callers
Improve the diagnostics of buffer pool accesses for B-trees,
so that the file names and line numbers of the real calls are shown
instead of the line of the buf_page_get() call in btr_block_get().
btr_page_get(): Replaced with a macro.
btr_block_get_func(): Renamed from btr_block_get(). Add file, line.
btr_block_get(): A macro that passes the __FILE__, __LINE__ to
btr_block_get_func().
dict_truncate_index_tree(): Replace a btr_page_get() call
with btr_block_get(), since we are only latching the page, not accessing it.
modified:
storage/innodb_plugin/ChangeLog
storage/innodb_plugin/dict/dict0crea.c
storage/innodb_plugin/include/btr0btr.h
storage/innodb_plugin/include/btr0btr.ic
3652 Marko Mäkelä 2010-11-03
Non-functional change: Remove bogus const qualifiers
and make some function comments more accurate.
modified:
storage/innodb_plugin/btr/btr0cur.c
storage/innodb_plugin/include/btr0cur.h
storage/innodb_plugin/include/row0ins.h
storage/innodb_plugin/include/row0upd.h
storage/innodb_plugin/row/row0ins.c
storage/innodb_plugin/row/row0upd.c
3651 Sunny Bains 2010-11-03
Fix Bug #54538 - use of exclusive innodb dictionary lock limits performance.
This patch doesn't get rid of the need to acquire the dict_sys->mutex but
reduces the need to keep the mutex locked for the duration of the query
to fsp_get_available_space_in_free_extents() from ha_innobase::info().
This is a port of revno:3548 from the builtin to the plugin.
rb://501 Approved by Jimmy Yang and Marko Makela.
modified:
storage/innodb_plugin/fil/fil0fil.c
storage/innodb_plugin/fsp/fsp0fsp.c
storage/innodb_plugin/handler/ha_innodb.cc
storage/innodb_plugin/include/fil0fil.h
storage/innodb_plugin/include/univ.i
=== modified file 'storage/innodb_plugin/ChangeLog'
--- a/storage/innodb_plugin/ChangeLog revid:sunny.bains@stripped
+++ b/storage/innodb_plugin/ChangeLog revid:marko.makela@oracle.com-20101103091912-tlsgb3c8yp1mx6m1
@@ -1,3 +1,9 @@
+2010-11-03 The InnoDB Team
+
+ * include/btr0btr.h, include/btr0btr.ic, dict/dict0crea.c:
+ Fix Bug#57947 InnoDB diagnostics shows btr_block_get calls
+ instead of real callers
+
2010-11-02 The InnoDB Team
* row/row0sel.c:
=== modified file 'storage/innodb_plugin/btr/btr0cur.c'
--- a/storage/innodb_plugin/btr/btr0cur.c revid:sunny.bains@stripped
+++ b/storage/innodb_plugin/btr/btr0cur.c revid:marko.makela@oracle.com-20101103091912-tlsgb3c8yp1mx6m1
@@ -953,7 +953,7 @@ btr_cur_ins_lock_and_undo(
not zero, the parameters index and thr
should be specified */
btr_cur_t* cursor, /*!< in: cursor on page after which to insert */
- const dtuple_t* entry, /*!< in: entry to insert */
+ dtuple_t* entry, /*!< in/out: entry to insert */
que_thr_t* thr, /*!< in: query thread or NULL */
mtr_t* mtr, /*!< in/out: mini-transaction */
ibool* inherit)/*!< out: TRUE if the inserted new record maybe
@@ -3794,7 +3794,7 @@ Stores the fields in big_rec_vec to the
them in rec. The extern flags in rec will have to be set beforehand.
The fields are stored on pages allocated from leaf node
file segment of the index tree.
-@return DB_SUCCESS or error */
+@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
UNIV_INTERN
ulint
btr_store_big_rec_extern_fields(
=== modified file 'storage/innodb_plugin/dict/dict0crea.c'
--- a/storage/innodb_plugin/dict/dict0crea.c revid:sunny.bains@stripped
+++ b/storage/innodb_plugin/dict/dict0crea.c revid:marko.makela@oracle.com-20101103091912-tlsgb3c8yp1mx6m1
@@ -828,7 +828,7 @@ dict_truncate_index_tree(
appropriate field in the SYS_INDEXES record: this mini-transaction
marks the B-tree totally truncated */
- btr_page_get(space, zip_size, root_page_no, RW_X_LATCH, mtr);
+ btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, mtr);
btr_free_root(space, zip_size, root_page_no, mtr);
create:
=== modified file 'storage/innodb_plugin/include/btr0btr.h'
--- a/storage/innodb_plugin/include/btr0btr.h revid:sunny.bains@stripped
+++ b/storage/innodb_plugin/include/btr0btr.h revid:marko.makela@oracle.com-20101103091912-tlsgb3c8yp1mx6m1
@@ -94,26 +94,35 @@ btr_root_get(
Gets a buffer page and declares its latching order level. */
UNIV_INLINE
buf_block_t*
-btr_block_get(
-/*==========*/
- ulint space, /*!< in: space id */
- ulint zip_size, /*!< in: compressed page size in bytes
- or 0 for uncompressed pages */
- ulint page_no, /*!< in: page number */
- ulint mode, /*!< in: latch mode */
- mtr_t* mtr); /*!< in: mtr */
-/**************************************************************//**
-Gets a buffer page and declares its latching order level. */
-UNIV_INLINE
-page_t*
-btr_page_get(
-/*=========*/
- ulint space, /*!< in: space id */
- ulint zip_size, /*!< in: compressed page size in bytes
- or 0 for uncompressed pages */
- ulint page_no, /*!< in: page number */
- ulint mode, /*!< in: latch mode */
- mtr_t* mtr); /*!< in: mtr */
+btr_block_get_func(
+/*===============*/
+ ulint space, /*!< in: space id */
+ ulint zip_size, /*!< in: compressed page size in bytes
+ or 0 for uncompressed pages */
+ ulint page_no, /*!< in: page number */
+ ulint mode, /*!< in: latch mode */
+ const char* file, /*!< in: file name */
+ ulint line, /*!< in: line where called */
+ mtr_t* mtr) /*!< in/out: mtr */
+ __attribute__((nonnull));
+/** Gets a buffer page and declares its latching order level.
+@param space tablespace identifier
+@param zip_size compressed page size in bytes or 0 for uncompressed pages
+@param page_no page number
+@param mode latch mode
+@param mtr mini-transaction handle
+@return the block descriptor */
+# define btr_block_get(space,zip_size,page_no,mode,mtr) \
+ btr_block_get_func(space,zip_size,page_no,mode,__FILE__,__LINE__,mtr)
+/** Gets a buffer page and declares its latching order level.
+@param space tablespace identifier
+@param zip_size compressed page size in bytes or 0 for uncompressed pages
+@param page_no page number
+@param mode latch mode
+@param mtr mini-transaction handle
+@return the uncompressed page frame */
+# define btr_page_get(space,zip_size,page_no,mode,mtr) \
+ buf_block_get_frame(btr_block_get(space,zip_size,page_no,mode,mtr))
#endif /* !UNIV_HOTBACKUP */
/**************************************************************//**
Gets the index id field of a page.
=== modified file 'storage/innodb_plugin/include/btr0btr.ic'
--- a/storage/innodb_plugin/include/btr0btr.ic revid:sunny.bains@oracle.com-20101103014053-rlghb3z1wfbc45al
+++ b/storage/innodb_plugin/include/btr0btr.ic revid:marko.makela@stripped-20101103091912-tlsgb3c8yp1mx6m1
@@ -39,18 +39,21 @@ Created 6/2/1994 Heikki Tuuri
Gets a buffer page and declares its latching order level. */
UNIV_INLINE
buf_block_t*
-btr_block_get(
-/*==========*/
- ulint space, /*!< in: space id */
- ulint zip_size, /*!< in: compressed page size in bytes
- or 0 for uncompressed pages */
- ulint page_no, /*!< in: page number */
- ulint mode, /*!< in: latch mode */
- mtr_t* mtr) /*!< in: mtr */
+btr_block_get_func(
+/*===============*/
+ ulint space, /*!< in: space id */
+ ulint zip_size, /*!< in: compressed page size in bytes
+ or 0 for uncompressed pages */
+ ulint page_no, /*!< in: page number */
+ ulint mode, /*!< in: latch mode */
+ const char* file, /*!< in: file name */
+ ulint line, /*!< in: line where called */
+ mtr_t* mtr) /*!< in/out: mtr */
{
buf_block_t* block;
- block = buf_page_get(space, zip_size, page_no, mode, mtr);
+ block = buf_page_get_gen(space, zip_size, page_no, mode,
+ NULL, BUF_GET, file, line, mtr);
if (mode != RW_NO_LATCH) {
@@ -61,23 +64,6 @@ btr_block_get(
}
/**************************************************************//**
-Gets a buffer page and declares its latching order level. */
-UNIV_INLINE
-page_t*
-btr_page_get(
-/*=========*/
- ulint space, /*!< in: space id */
- ulint zip_size, /*!< in: compressed page size in bytes
- or 0 for uncompressed pages */
- ulint page_no, /*!< in: page number */
- ulint mode, /*!< in: latch mode */
- mtr_t* mtr) /*!< in: mtr */
-{
- return(buf_block_get_frame(btr_block_get(space, zip_size, page_no,
- mode, mtr)));
-}
-
-/**************************************************************//**
Sets the index id field of a page. */
UNIV_INLINE
void
=== modified file 'storage/innodb_plugin/include/btr0cur.h'
--- a/storage/innodb_plugin/include/btr0cur.h revid:sunny.bains@stripped3-rlghb3z1wfbc45al
+++ b/storage/innodb_plugin/include/btr0cur.h revid:marko.makela@strippedb3c8yp1mx6m1
@@ -520,7 +520,7 @@ Stores the fields in big_rec_vec to the
them in rec. The extern flags in rec will have to be set beforehand.
The fields are stored on pages allocated from leaf node
file segment of the index tree.
-@return DB_SUCCESS or error */
+@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
UNIV_INTERN
ulint
btr_store_big_rec_extern_fields(
=== modified file 'storage/innodb_plugin/include/row0ins.h'
--- a/storage/innodb_plugin/include/row0ins.h revid:sunny.bains@stripped4053-rlghb3z1wfbc45al
+++ b/storage/innodb_plugin/include/row0ins.h revid:marko.makela@strippedlsgb3c8yp1mx6m1
@@ -84,7 +84,7 @@ ulint
row_ins_index_entry(
/*================*/
dict_index_t* index, /*!< in: index */
- dtuple_t* entry, /*!< in: index entry to insert */
+ dtuple_t* entry, /*!< in/out: index entry to insert */
ulint n_ext, /*!< in: number of externally stored columns */
ibool foreign,/*!< in: TRUE=check foreign key constraints */
que_thr_t* thr); /*!< in: query thread */
=== modified file 'storage/innodb_plugin/include/row0upd.h'
--- a/storage/innodb_plugin/include/row0upd.h revid:sunny.bains@stripped45al
+++ b/storage/innodb_plugin/include/row0upd.h revid:marko.makela@stripped
@@ -126,8 +126,8 @@ UNIV_INTERN
void
row_upd_index_entry_sys_field(
/*==========================*/
- const dtuple_t* entry, /*!< in: index entry, where the memory buffers
- for sys fields are already allocated:
+ dtuple_t* entry, /*!< in/out: index entry, where the memory
+ buffers for sys fields are already allocated:
the function just copies the new values to
them */
dict_index_t* index, /*!< in: clustered index */
=== modified file 'storage/innodb_plugin/row/row0ins.c'
--- a/storage/innodb_plugin/row/row0ins.c revid:sunny.bains@stripped0101103014053-rlghb3z1wfbc45al
+++ b/storage/innodb_plugin/row/row0ins.c revid:marko.makela@stripped912-tlsgb3c8yp1mx6m1
@@ -1781,7 +1781,7 @@ ulint
row_ins_duplicate_error_in_clust(
/*=============================*/
btr_cur_t* cursor, /*!< in: B-tree cursor */
- dtuple_t* entry, /*!< in: entry to insert */
+ const dtuple_t* entry, /*!< in: entry to insert */
que_thr_t* thr, /*!< in: query thread */
mtr_t* mtr) /*!< in: mtr */
{
@@ -1977,7 +1977,7 @@ row_ins_index_entry_low(
depending on whether we wish optimistic or
pessimistic descent down the index tree */
dict_index_t* index, /*!< in: index */
- dtuple_t* entry, /*!< in: index entry to insert */
+ dtuple_t* entry, /*!< in/out: index entry to insert */
ulint n_ext, /*!< in: number of externally stored columns */
que_thr_t* thr) /*!< in: query thread */
{
@@ -2158,7 +2158,7 @@ ulint
row_ins_index_entry(
/*================*/
dict_index_t* index, /*!< in: index */
- dtuple_t* entry, /*!< in: index entry to insert */
+ dtuple_t* entry, /*!< in/out: index entry to insert */
ulint n_ext, /*!< in: number of externally stored columns */
ibool foreign,/*!< in: TRUE=check foreign key constraints */
que_thr_t* thr) /*!< in: query thread */
=== modified file 'storage/innodb_plugin/row/row0upd.c'
--- a/storage/innodb_plugin/row/row0upd.c revid:sunny.bains@stripped
+++ b/storage/innodb_plugin/row/row0upd.c revid:marko.makela@oracle.com-20101103091912-tlsgb3c8yp1mx6m1
@@ -371,8 +371,8 @@ UNIV_INTERN
void
row_upd_index_entry_sys_field(
/*==========================*/
- const dtuple_t* entry, /*!< in: index entry, where the memory buffers
- for sys fields are already allocated:
+ dtuple_t* entry, /*!< in/out: index entry, where the memory
+ buffers for sys fields are already allocated:
the function just copies the new values to
them */
dict_index_t* index, /*!< in: clustered index */
@@ -1587,12 +1587,12 @@ static
ulint
row_upd_clust_rec_by_insert(
/*========================*/
- upd_node_t* node, /*!< in: row update node */
+ upd_node_t* node, /*!< in/out: row update node */
dict_index_t* index, /*!< in: clustered index of the record */
que_thr_t* thr, /*!< in: query thread */
ibool check_ref,/*!< in: TRUE if index may be referenced in
a foreign key constraint */
- mtr_t* mtr) /*!< in: mtr; gets committed here */
+ mtr_t* mtr) /*!< in/out: mtr; gets committed here */
{
mem_heap_t* heap = NULL;
btr_pcur_t* pcur;
Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20101103091912-tlsgb3c8yp1mx6m1.bundle
| Thread |
|---|
| • bzr push into mysql-5.1-innodb branch (marko.makela:3651 to 3653) Bug#57947 | marko.makela | 3 Nov |