Commit graph

3802 commits

Author SHA1 Message Date
Georgi Kodinov
8aa1e57941 weave merge mysql-5.1->mysql-5.1-security 2012-01-12 16:42:23 +02:00
Karen Langford
4b0d98b28c Merge from mysql-5.1.61-release 2012-01-11 18:51:42 +01:00
Yasufumi Kinoshita
115f5e8551 Bug#12400341 INNODB CAN LEAVE ORPHAN IBD FILES AROUND
If we meet DB_TOO_MANY_CONCURRENT_TRXS during the execution tab_create_graph from row_create_table_for_mysql(), .ibd file for the table should be created already but was not deleted for the error handling.

rb:875 approved by Jimmy Yang
2012-01-10 14:18:58 +09:00
Marko Mäkelä
e498a1bf65 Bug#13418934 REMOVE HAVE_PURIFY DEPENDENCES FROM INNODB
InnoDB: Remove HAVE_purify, UNIV_INIT_MEM_TO_ZERO, UNIV_SET_MEM_TO_ZERO.

The compile-time setting HAVE_purify can mask potential bugs.
It is being set in PB2 Valgrind runs. We should simply get rid of it,
and replace it with UNIV_MEM_INVALID() to declare uninitialized memory
as such in Valgrind-instrumented binaries.

os_mem_alloc_large(), ut_malloc_low(): Remove the parameter set_to_zero.

ut_malloc(): Define as a macro that invokes ut_malloc_low().

buf_pool_init(): Never initialize the buffer pool frames. All pages
must be initialized before flushing them to disk.

mem_heap_alloc(): Never initialize the allocated memory block.

os_mem_alloc_nocache(), ut_test_malloc(): Unused function, remove.

rb:813 approved by Jimmy Yang
2011-12-28 12:19:30 +02:00
Ramil Kalimullin
289af2579b Fix for bug#11758931 - 51196: SLAVE SQL: GOT AN ERROR WRITING
COMMUNICATION PACKETS, ERROR_CODE: 1160

Addendum: for some queries table->in_use might be NULL -
check it.
2011-12-23 18:52:44 +04:00
Ramil Kalimullin
790a3a46f3 Fix for bug#11758931 - 51196: SLAVE SQL: GOT AN ERROR WRITING
COMMUNICATION PACKETS, ERROR_CODE: 1160

If idle FEDERATED table is evicted from the table cache when 
a connection to remote server is lost, query that initiated 
eviction may fail.
If this query is executed by slave SQL thread it may fail as well.

An error of close was stored in diagnostics area, which was later
attributed to the statement that caused eviction.

With this patch FEDERATED clears an error of close.
2011-12-23 17:22:48 +04:00
Vasil Dimov
86505c3c54 Fix Bug#13510739 63775: SERVER CRASH ON HANDLER READ NEXT AFTER DELETE RECORD.
CREATE TABLE bug13510739 (c INTEGER NOT NULL, PRIMARY KEY (c)) ENGINE=INNODB;
INSERT INTO bug13510739 VALUES (1), (2), (3), (4);
DELETE FROM bug13510739 WHERE c=2;
HANDLER bug13510739 OPEN;
HANDLER bug13510739 READ `primary` = (2);
HANDLER bug13510739 READ `primary` NEXT;  <-- crash

The bug is that in the particular testcase row_search_for_mysql() picked up
a delete-marked record and quit, leaving the cursor non-positioned state and
on the subsequent 'get next' call the code crashed because of the
non-positioned cursor.

In row0sel.cc (line numbers from mysql-trunk):

4653         if (rec_get_deleted_flag(rec, comp)) {
...
4679                 if (index == clust_index && unique_search) {
4680 
4681                         err = DB_RECORD_NOT_FOUND;
4682                         
4683                         goto normal_return;
4684                 }       

it quit from here, not storing the cursor position.

In contrast, if the record=2 is not found at all (e.g. sleep(1) after DELETE
to let the purge wipe it away completely) then 'get = 2' does find record=3
and quits from here:

4366                 if (0 != cmp_dtuple_rec(search_tuple, rec, offsets)) {
...
4394                         btr_pcur_store_position(pcur, &mtr);
4395 
4396                         err = DB_RECORD_NOT_FOUND;
4397 #if 0
4398                         ut_print_name(stderr, trx, FALSE, index->name);
4399                         fputs(" record not found 3\n", stderr);
4400 #endif
4401 
4402                         goto normal_return;

Another fix could be to extend the condition on line 4366 to hold only if
seach_tuple matches rec AND if rec is not delete marked.

Notice that in the above test case if we wait about 1 second somewhere after
DELETE and before 'get = 2', then the testcase does not crash and returns 4
instead. Not sure if this is the correct behavior, but this bugfix removes
the crash and makes the code return what it also returns in the non-crashing
case (if rec=2 is not found during 'get = 2', e.g. we have sleep(1) there).

Approved by:	Marko (http://bur03.no.oracle.com/rb/r/863/)
2011-12-22 12:55:44 +02:00
Inaam Rana
564d4a65bd Add ChangeLog message. 2011-12-21 21:36:52 -05:00
Inaam Rana
3953b48971 Bug#11866367 FPE WHEN SETTING INNODB_SPIN_WAIT_DELAY
rb://865
approved by: Jimmy

Integer overflow causes division by zero.
2011-12-21 21:33:13 -05:00
Georgi Kodinov
65fbeccd23 merge mysql-5.1->mysql-5.1-security 2011-12-15 14:10:20 +02:00
Mattias Jonsson
52076824c9 merge 2011-12-14 14:41:40 +01:00
Annamalai Gurusami
ad84fb5c37 Bug #13117023: Innodb increments handler_read_key when it should not
The counter handler_read_key (SSV::ha_read_key_count) is incremented 
incorrectly.

The mysql server maintains a per thread system_status_var (SSV)
object.  This object contains among other things the counter
SSV::ha_read_key_count. The purpose of this counter is to measure the
number of requests to read a row based on a key (or the number of
index lookups).

This counter was wrongly incremented in the
ha_innobase::innobase_get_index(). The fix removes
this increment statement (for both innodb and innodb_plugin).

The various callers of the innobase_get_index() was checked to
determine if anybody must increment this counter (if they first call
innobase_get_index() and then perform an index lookup).  It was found
that no caller of innobase_get_index() needs to worry about the
SSV::ha_read_key_count counter.
2011-12-13 14:26:12 +05:30
Marko Mäkelä
3d58fd6900 Bug#13418887 ERROR IN DIAGNOSTIC FUNCTION PAGE_REC_PRINT()
When printing information about a ROW_FORMAT=REDUNDANT record, pass
the correct flag to rec_get_next_offs().

rb:821 approved by Jimmy Yang
2011-12-12 13:48:24 +02:00
Georgi Kodinov
dfc9bbff2a merge 5.1->5.1-security. 2011-12-12 12:25:35 +01:00
Nirbhay Choubey
c67a91f11a Bug#11756764 48726: MYSQLD KEEPS CRASHING WITH SIGSEGV
WITH MYISAM_USE_MMAP ENABLED

MySQL server can crash due to segmentation fault when
started with myisam_use_mmap.

The reason behind this being, while making a request to
unmap (munmap) the previously mapped memory (mmap), the
size passed was 7 bytes larger than the size requested at
the time of mapping. This can eventually unmap the adjacent
memory mapped block, belonging to some other memory-map pool.
Hence the subsequent call to mmap can map a region which was
still a valid memory mapped area.

Fixed by removing the extra 7-byte margin which was erroneously
added to the size, used for unmappping.


storage/myisam/mi_close.c:
  Bug#11756764 48726: MYSQLD KEEPS CRASHING WITH SIGSEGV
                      WITH MYISAM_USE_MMAP ENABLED
  
  Added a condition to call _mi_unmap_file() in case
  of compressed records. mi_munmap_file() is called
  otherwise.
storage/myisam/mi_packrec.c:
  Bug#11756764 48726: MYSQLD KEEPS CRASHING WITH SIGSEGV
                      WITH MYISAM_USE_MMAP ENABLED
  
  mi_dynmap_file() function, after successfully executing
  mmap, stores the total size in info->s->mapped_length
  variable. Now, if mi_dynmap_file() is invoked with a size
  with an extra 7-byte margin (MEMMAP_EXTRA_MARGIN),
  the margin will eventually also get stored in mapped_length.
  So, un-mapping function can simply use the value stored in
  mapped_length in order to unmap the previously mapped
  region.
2011-11-29 17:59:35 +05:30
Ashish Agarwal
a00f87bf15 BUG#11751793 - 42784: ARCHIVE TABLES CAUSE 100% CPU USAGE
AND HANG IN SHOW TABLE STATUS.

ISSUE: Table corruption due to concurrent queries.
       Different threads running insert and check
       query leads to table corruption. Not properly locked,
       rows are inserted in between check query.

SOLUTION: In check query mutex lock is acquired
          for a longer time to handle concurrent
          insert and check query.

NOTE: Additionally we backported the fix for CHECKSUM
      issue(bug#11758979).
2011-11-23 18:33:29 +05:30
Inaam Rana
f28e7bd064 Bug#13390506 - VALGRIND FAILURE AFTER THE FIX FOR 13371000
rb://816
approved by: Marko Makela
  
The title is misleading. This bug was actually introduced by
bug 12635227 and was unearthed by a later optimization.
We need to free buf_page_t structs that we are allocating using
malloc() at shutdown.
2011-11-18 10:59:10 -05:00
Karen Langford
e1df69f75a Merge from mysql-5.1.60-release 2011-11-17 00:26:16 +01:00
Marko Mäkelä
a0a51251e4 Bug#11759688 52020: InnoDB can still deadlock on just INSERT...ON DUPLICATE KEY
a.k.a. Bug#7975 deadlock without any locking, simple select and update

Bug#7975 was reintroduced when the storage engine API was made
pluggable in MySQL 5.1. Instead of looking at thd->lex directly, we
rely on handler::extra(). But, we were looking at the wrong extra()
flag, and we were ignoring the TRX_DUP_REPLACE flag in places where we
should obey it.

innodb_replace.test: Add tests for hopefully all affected statement
types, so that bug should never ever resurface. This kind of tests
should have been added when fixing Bug#7975 in MySQL 5.0.3 in the
first place.

rb:806 approved by Sunny Bains
2011-11-10 12:49:31 +02:00
Marko Mäkelä
77eb01b827 Bug#13358468 ASSERTION FAILURE IN BTR_PCUR_GET_BLOCK
btr_pcur_restore_position_func(): When the cursor was positioned at
the tree infimum or supremum, initialize pos_state and latch_mode. The
assertion failed, because pos_state was BTR_PCUR_WAS_POSITIONED.  In
the test failure of WL#5874, the purge thread attempted to restore the
cursor position on the infimum record (the clustered index was empty).

btr_pcur_detach(), btr_pcur_is_detached(): Unused functions, remove.

rb:804 approved by Inaam Rana
2011-11-08 14:15:22 +02:00
Marko Mäkelä
b003b6294c Add debug assertions to catch Bug#13345378 earlier.
In all callers of row_sel_convert_mysql_key_to_innobase(), assert
that the converted key is empty or nonempty when it should be.
2011-11-07 13:37:19 +02:00
Georgi Kodinov
e68afa7c53 auto-merge mysql-5.1->mysql-5.5 2011-11-04 14:33:38 +02:00
Marko Mäkelä
1d9c841c3b Bug #12884631 62146: TABLES ARE LOST FOR DDL
row_rename_table_for_mysql(): Return DB_ERROR instead of DB_SUCCESS
when fil_rename_tablespace() returns an error. This bug was introduced
in the InnoDB Plugin.

Approved by Sunny Bains over IM.
2011-10-27 14:58:12 +03:00
Marko Mäkelä
2c67d5066d Revert revno:3452.71.32 (Bug#12612184 fix).
Bug#12612184 RACE CONDITION AFTER BTR_CUR_PESSIMISTIC_UPDATE()

The fix introduced potentially more severe crash recovery problems
than the bug causes. Revert the fix for now.
2011-10-26 12:23:57 +03:00
Marko Mäkelä
91b5e9352a Revert most of revno 3560.9.1 (Bug#12704861)
This was an attempt to address problems with the Bug#12612184 fix.
Even with this follow-up fix, crash recovery can be broken.
Let us fix the bug later.
2011-10-26 11:44:28 +03:00
Marko Mäkelä
013ba71dfd Bug#13002783 PARTIALLY UNINITIALIZED CASCADE UPDATE VECTOR
In the ON UPDATE CASCADE clause of FOREIGN KEY constraints, the
calculated update vector was not fully initialized. This bug was
introduced in the InnoDB Plugin when implementing support for
ROW_FORMAT=DYNAMIC.

Additionally, the data type information was not initialized, but
apparently it has never been needed in this case.  Nevertheless, it is
not good programming practice to pass uninitialized values around.

calc_row_difference(): Declare the update field uninitialized in
Valgrind. Copy the data type information as well, except when the
field is SQL NULL. In the built-in InnoDB, initialize
ufield->extern_storage = FALSE (an initialization bug that had gone
unnoticed this far). The InnoDB Plugin and later have this flag to
dfield_t and have always initialized it properly.

row_ins_cascade_calc_update_vec(): Reduce the scope of some
pointers. Initialize orig_len. (This caused the bug in InnoDB Plugin
and later.)

row_ins_foreign_check_on_constraint(): Simplify a condition. Declare
the update vector uninitialized.

rb:771 approved by Jimmy Yang
2011-10-25 17:33:38 +03:00
Sergey Vojtovich
e1c4021bde Merge. 2011-10-21 09:30:56 +04:00
Marko Mäkelä
8a0be8a541 Bug#13116045 Compilation failure using GCC 4.6.1 in btr/btr0cur.c
btr_record_not_null_field_in_rec(): Remove the parameter rec.
Use rec_offs_nth_sql_null() instead of rec_get_nth_field().

rb:788 approved by Jimmy Yang
2011-10-21 06:32:16 +03:00
Sergey Vojtovich
de8c70e70b BUG#11757032 - 49030: OPTIMIZE TABLE BREAKS MYISAM TABLE WHEN
USING MYISAM_USE_MMAP ON WINDOWS

When OPTIMIZE/REPAIR TABLE is switching to new data file,
old data file is removed while memory mapping is still
active.

With 5.1 implementation of nt_share_delete() it is not
permitted to remove mmaped file.

This fix disables memory mapping for mi_repair() operations.

mysql-test/r/myisam.result:
  A test case for BUG#11757032.
mysql-test/t/myisam.test:
  A test case for BUG#11757032.
storage/myisam/ha_myisam.cc:
  mi_repair*() functions family use file I/O even if memory
  mapping is available.
  
  Since mixing mmap I/O and file I/O may cause various artifacts,
  memory mapping must be disabled.
storage/myisam/mi_delete_all.c:
  Clean-up: do not attempt to remap file after truncate, since
  there is nothing to map.
2011-10-20 15:03:22 +04:00
Marko Mäkelä
6d59064948 Bug#13006367 62487: innodb takes 3 minutes to clean up the adaptive
hash index at shutdown

btr_search_disable(): Just drop the entire adaptive hash index,
without dropping every record separately.

buf_pool_clear_hash_index(): Renamed and simplified from
buf_pool_drop_hash_index(). Set block->index = NULL for every block in
the buffer pool. Do not release the btr_search_latch. The caller will
have to adjust other data structures.

Remove block->is_hashed. It is redundant, should be always equal to
block->index != NULL.

Remove btr_search_fully_disabled, btr_search_enabled_mutex, and
SYNC_SEARCH_SYS_CONF. We drop the AHI in one pass, without releasing
the btr_search_latch in between.

Replace void* with const rec_t* and add assertions on btr_search_latch
and btr_search_enabled to ha0ha.h, ha0ha.ic, ha0ha.c.

page_set_max_trx_id(): Ignore the adaptive hash index. I forgot to
push this in rb:750.

btr0sea.c: Always after acquiring btr_search_latch, check for
block->index==NULL or !btr_search_enabled. We can now set
block->index=NULL while only holding btr_search_latch in exclusive
mode. Always acquire btr_search_latch before reading block->index,
except in shortcuts when testing for block->index == NULL.

ha_clear(), ha_search(): Unused function, remove.

buf_page_peek_if_search_hashed(): Remove. This function may avoid
latching a page at the cost of doing a duplicate buf_pool->page_hash
lookup.

rb:775 approved by Inaam Rana
2011-10-12 09:00:49 +03:00
Marko Mäkelä
16c919527f Add InnoDB UNIV_SYNC_DEBUG assertions to rw-lock code.
rw_lock_x_lock_func(): Assert that the thread is not already holding
the lock in a conflicting mode (RW_LOCK_SHARED).

rw_lock_s_lock_func(): Assert that the thread is not already holding
the lock in a conflicting mode (RW_LOCK_EX).
2011-10-05 12:01:47 +03:00
Marko Mäkelä
96c2c18e4f Correct the ChangeLog 2011-10-04 21:01:40 +03:00
unknown
c6d47e6e01 Bug#12980094 and Bug#13034534
Bug 12980094 - ASSERTION IN INNODB DETECTED IN RQG_PARTITION_DDL
Bug 13034534 - RQG TESTS FAIL ON WINDOWS WITH CRASH NEAR RW_LOCK_DEBUG_PRINT

All access to struct rw_lock_debug_struct must be protected by rw_lock_debug_mutex_enter().
2011-10-04 09:21:47 -05:00
Ashish Agarwal
5dbcff9b9c BUG#11759349 - 51655: CREATE TABLE IN MEMORY ENGINE DOESN'T STORE
CREATE_TIME IN INFORMATION_SC

It was impossible to determine MEMORY table creation time,
since it wasn't stored/exposed.

With this patch creation time is saved and it is available via
I_S.TABLES.CREATE_TIME.

Note: it was decided that additional analysis is required before
implementing UPDATE_TIME. Thus this patch doesn't store UPDATE_TIME.
2011-09-27 17:38:51 +05:30
Bjorn Munch
031b52c415 merge from 5.1 main 2011-09-26 10:06:25 +02:00
Marko Mäkelä
7f729cfac4 Bug#12963823 CRASH IN PURGE THREAD UNDER UNUSUAL CIRCUMSTANCES
Replace part of the patch that Kevin apparently forgot to push.
Fix the bug also in the built-in InnoDB of MySQL 5.1.

I cannot explain why the test case was not failing without the
full patch.

This was rb:762, approved by me.
2011-09-22 13:35:02 +03:00
unknown
265737d141 Bug 12963823 - Crash in Purge thread under unusual circumstances.
The problem occurred when indexes are added between the time that an
UNDO record is created and the time that the purge thread comes around
and deletes the old secondary index entries.  The purge thread would
hit an assert when trying to build a secondary index entry for
searching.  The problem was that the old value of those fields were not
in the UNDO record since they were not part of an index when the UPDATE
occured. 
A test case was added to innodb-index.test.
2011-09-20 18:12:36 -06:00
Bjorn Munch
50efe241c9 merge from 5.1 main minus merge jam pushes 2011-09-20 12:12:46 +02:00
Sergey Vojtovich
a33b42146e Merge. 2011-09-16 16:03:08 +04:00
Sergey Vojtovich
3f9cbd7731 BUG#11761180 - 53646: MYISAMPACK CORRUPTS TABLES WITH
FULLTEXT INDEXES

myisamchk may create incorrect fulltext index for compressed
tables. Incorrect data pointer size was used while creating
fulltext index.

mysql-test/r/myisampack.result:
  A test case for BUG#11761180.
mysql-test/t/myisampack.test:
  A test case for BUG#11761180.
storage/myisam/ft_boolean_search.c:
  rec_reflength on share may have adjustments required for
  compressed tables and must be used instead of rec_reflength
  on base info.
storage/myisam/ft_nlq_search.c:
  rec_reflength on share may have adjustments required for
  compressed tables and must be used instead of rec_reflength
  on base info.
storage/myisam/mi_check.c:
  rec_reflength on share may have adjustments required for
  compressed tables and must be used instead of rec_reflength
  on base info.
storage/myisam/mi_write.c:
  rec_reflength on share may have adjustments required for
  compressed tables and must be used instead of rec_reflength
  on base info.
2011-09-16 15:30:31 +04:00
unknown
40761a9a73 Merge from mysql-5.1.59-release 2011-09-15 18:48:54 +02:00
Marko Mäkelä
d60cdefc0d Hopefully really final fix of Bug#11766591 59733: Possible deadlock
when buffered changes are to be discarded

sync_thread_add_level(level = SYNC_IBUF_INDEX_TREE): Relax a too strict
condition that the thread must not be holding locks below SYNC_FSP_PAGE.
It is perfectly valid to hold any latch above SYNC_IBUF_INDEX_TREE when
acquiring the insert buffer tree latch.
2011-09-14 15:39:36 +03:00
Vasil Dimov
37f4deccd0 Re-enable the prefetch code in InnoDB internal SQL parser and fix two
bugs in it - accessing uninitialized ::len member (thanks, Jimmy!)
and a memory leak.

This is a followup to vasil.dimov@oracle.com-20110909070724-jvirxnpkbxieauz5
which disabled the prefetch code.
2011-09-13 17:18:06 +03:00
Marko Mäkelä
3436169892 Hopefully final fix of Bug#11766591 59733: Possible deadlock
when buffered changes are to be discarded

ibuf_add_free_page(): Lower the latching order of the newly allocated page
to SYNC_IBUF_TREE_NODE_NEW after latching the insert buffer tree root.

This bug always was bogus UNIV_SYNC_DEBUG alarm. The function
buf_block_dbg_add_level() is a no-op unless UNIV_SYNC_DEBUG is defined.
2011-09-13 09:18:34 +03:00
Marko Mäkelä
cc496eb746 Bug#12601439 CONSISTENT READ FAILURE IN COLUMN PREFIX INDEX
When there is a secondary index on a column prefix of an externally
stored column and an entry in the secondary index is shorter than the
reserved prefix length, it should mean that the secondary index entry
is holding the complete column value. When comparing this secondary
index column value to the column in the clustered index row, we must
compare the entire prefix that was fetched from the clustered
index. The bug was that we would just compare that the column in the
clustered index starts with the value found in the secondary index
column.

This bug affects only the InnoDB Barracuda formats (ROW_FORMAT=DYNAMIC
and ROW_FORMAT=COMPRESSED), in which columns that are stored off-page
in the clustered index do not contain any prefix in the clustered
index record.

row_sel_sec_rec_is_for_blob(): Add the parameter prefix_len, for
ifield->prefix_len. Add some assertions.

Sorry, I did not manage to produce a test case. This patch does
produce correct results on the data set that Michael isolated on our
test machine. That was with the purge and background rollback
suspended, because they would make the bug go away.

rb:760 approved by Sunny Bains
2011-09-12 10:12:15 +03:00
Vasil Dimov
13fefeb04a Disable the prefetch code in the InnoDB internal SQL parser.
This change is a followup to
vasil.dimov@oracle.com-20110907145810-v98kldmho23vhhic
which triggered the usage of the prefetch and valgrind tests spat lots of
warnings.

The prefetch code will be removed.

Discussed with:	Marko (over IM)
2011-09-09 10:07:24 +03:00
Marko Mäkelä
8c545acd53 Bug#12948130 UNNECESSARY X-LOCKING OF ADAPTIVE HASH INDEX (BTR_SEARCH_LATCH)
InnoDB acquires an x-latch on btr_search_latch for certain in-place updates
that do affect the adaptive hash index. These operations do not really need
to be protected by the btr_search_latch:

* updating DB_TRX_ID
* updating DB_ROLL_PTR
* updating PAGE_MAX_TRX_ID
* updating the delete-mark flag

rb:750 approved by Sunny Bains
2011-09-08 16:10:24 +03:00
Marko Mäkelä
132f023b08 Bug#11766591 59733: POSSIBLE DEADLOCK WHEN BUFFERED CHANGES ARE DISCARDED
Tweak the faulty UNIV_SYNC_DEBUG diagnostics a little bit more.

ibuf_add_free_page(): Lower the latching order of the newly allocated page
only after acquiring the ibuf_mutex.
2011-09-08 15:54:15 +03:00
Vasil Dimov
10e7b94834 Use cursors for seeking records in SYS_FOREIGN and SYS_INDEXES from
DROP_TABLE_PROC().

With this change I observe a speedup from 6.2s to 0.1s when executing
DROP_TABLE_PROC() during DROP TABLE with 512 foreign keys, like what
is being done in innodb_bug56143.test

This fixes "Bug#11765460 DROP TABLE USES INEFFICIENT METHODS TO REMOVE
FKS/INDEXES FROM INNODB SYS TABLES"

Reviewed by:	Marko
2011-09-07 17:58:10 +03:00
Marko Mäkelä
7f48c174f0 Bug #12950803 62294: BUF_BUDDY_RELOCATE CALLS GETTIMEOFDAY ...
buf_buddy_relocate(): The ut_time_us() function is needed for
statistics, calculating the total time spent on relocating blocks.
Until now, we invoked ut_time_us() every time buf_buddy_relocate() was
called. Fix: Only call ut_time_us() when the block can be relocated.
After this fix, the reported relocated_usec will no longer include the
time for the page_hash lookup and for acquiring the block mutex.

Approved by Sunny Bains on IM
2011-09-06 10:08:52 +03:00