From f54dcf1e8742e19d13ab7fb8b92ae6a179e67fe3 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 14 Jun 2016 12:38:47 +0200 Subject: 5.5.49-37.9 --- storage/xtradb/dict/dict0crea.c | 4 ++-- storage/xtradb/handler/ha_innodb.cc | 2 +- storage/xtradb/include/os0sync.h | 47 ++++++++++++++++++------------------ storage/xtradb/include/univ.i | 2 +- storage/xtradb/log/log0recv.c | 4 ++-- storage/xtradb/os/os0file.c | 48 ++++++++++++++++++++++++++++++++++++- 6 files changed, 76 insertions(+), 31 deletions(-) diff --git a/storage/xtradb/dict/dict0crea.c b/storage/xtradb/dict/dict0crea.c index 44ebca83373..b950c2d9b3f 100644 --- a/storage/xtradb/dict/dict0crea.c +++ b/storage/xtradb/dict/dict0crea.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1255,7 +1255,7 @@ dict_create_index_step( >= DICT_TF_FORMAT_ZIP); node->index = dict_index_get_if_in_cache_low(index_id); - ut_a((node->index == 0) == (err != DB_SUCCESS)); + ut_a((node->index == NULL) == (err != DB_SUCCESS)); if (err != DB_SUCCESS) { diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index effff7cf0c4..896b27a2047 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -12605,7 +12605,7 @@ innodb_buffer_pool_evict_update( mutex_enter(&block->mutex); buf_LRU_free_block(&block->page, - FALSE, FALSE); + FALSE, TRUE); mutex_exit(&block->mutex); block = prev_block; } diff --git a/storage/xtradb/include/os0sync.h b/storage/xtradb/include/os0sync.h index 83647fe3367..d7dee5e0567 100644 --- a/storage/xtradb/include/os0sync.h +++ b/storage/xtradb/include/os0sync.h @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -41,7 +41,6 @@ Created 9/6/1995 Heikki Tuuri || defined _M_X64 || defined __WIN__ #define IB_STRONG_MEMORY_MODEL -#undef HAVE_IB_GCC_ATOMIC_TEST_AND_SET // Quick-and-dirty fix for bug 1519094 #endif /* __i386__ || __x86_64__ || _M_IX86 || M_X64 || __WIN__ */ @@ -332,28 +331,7 @@ Returns the old value of *ptr, atomically sets *ptr to new_val */ # define os_atomic_test_and_set_byte(ptr, new_val) \ __sync_lock_test_and_set(ptr, (byte) new_val) -# if defined(HAVE_IB_GCC_ATOMIC_TEST_AND_SET) - -/** Do an atomic test-and-set. -@param[in,out] ptr Memory location to set to non-zero -@return the previous value */ -static inline -lock_word_t -os_atomic_test_and_set(volatile lock_word_t* ptr) -{ - return(__atomic_test_and_set(ptr, __ATOMIC_ACQUIRE)); -} - -/** Do an atomic clear. -@param[in,out] ptr Memory location to set to zero */ -static inline -void -os_atomic_clear(volatile lock_word_t* ptr) -{ - __atomic_clear(ptr, __ATOMIC_RELEASE); -} - -# elif defined(IB_STRONG_MEMORY_MODEL) +# if defined(IB_STRONG_MEMORY_MODEL) /** Do an atomic test and set. @param[in,out] ptr Memory location to set to non-zero @@ -382,6 +360,27 @@ os_atomic_clear(volatile lock_word_t* ptr) return(__sync_lock_test_and_set(ptr, 0)); } +# elif defined(HAVE_IB_GCC_ATOMIC_TEST_AND_SET) + +/** Do an atomic test-and-set. +@param[in,out] ptr Memory location to set to non-zero +@return the previous value */ +static inline +lock_word_t +os_atomic_test_and_set(volatile lock_word_t* ptr) +{ + return(__atomic_test_and_set(ptr, __ATOMIC_ACQUIRE)); +} + +/** Do an atomic clear. +@param[in,out] ptr Memory location to set to zero */ +static inline +void +os_atomic_clear(volatile lock_word_t* ptr) +{ + __atomic_clear(ptr, __ATOMIC_RELEASE); +} + # else # error "Unsupported platform" diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index 4814a07d3a4..d5ec85ce995 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -64,7 +64,7 @@ component, i.e. we show M.N.P as M.N */ (INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR) #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 37.8 +#define PERCONA_INNODB_VERSION 37.9 #endif #define INNODB_VERSION_STR MYSQL_SERVER_VERSION diff --git a/storage/xtradb/log/log0recv.c b/storage/xtradb/log/log0recv.c index f9eddec4b4a..3429361c74c 100644 --- a/storage/xtradb/log/log0recv.c +++ b/storage/xtradb/log/log0recv.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1837,7 +1837,7 @@ loop: goto loop; } - ut_ad((allow_ibuf == 0) == (mutex_own(&log_sys->mutex) != 0)); + ut_ad((!allow_ibuf) == mutex_own(&log_sys->mutex)); if (!allow_ibuf) { recv_no_ibuf_operations = TRUE; diff --git a/storage/xtradb/os/os0file.c b/storage/xtradb/os/os0file.c index 6e1b59aba12..21f8c3eed11 100644 --- a/storage/xtradb/os/os0file.c +++ b/storage/xtradb/os/os0file.c @@ -386,6 +386,43 @@ os_get_os_version(void) } #endif /* __WIN__ */ +/***********************************************************************//** +For an EINVAL I/O error, prints a diagnostic message if innodb_flush_method +== ALL_O_DIRECT. +@return TRUE if the diagnostic message was printed +@return FALSE if the diagnostic message does not apply */ +static +ibool +os_diagnose_all_o_direct_einval( +/*============================*/ + ulint err) /*!< in: C error code */ +{ + if ((err == EINVAL) + && (srv_unix_file_flush_method == SRV_UNIX_ALL_O_DIRECT)) { + fprintf(stderr, + "InnoDB: The error might be caused by redo log I/O " + "not satisfying innodb_flush_method=ALL_O_DIRECT " + "requirements by the underlying file system.\n"); + if (srv_log_block_size != 512) + fprintf(stderr, + "InnoDB: This might be caused by an " + "incompatible non-default " + "innodb_log_block_size value %lu.\n", + srv_log_block_size); + fprintf(stderr, + "InnoDB: Please file a bug at " + "https://bugs.percona.com and include this error " + "message, my.cnf settings, and information about the " + "file system where the redo log resides.\n"); + fprintf(stderr, + "InnoDB: A possible workaround is to change " + "innodb_flush_method value to something else " + "than ALL_O_DIRECT.\n"); + return(TRUE); + } + return(FALSE); +} + /***********************************************************************//** Retrieves the last error number if an error occurs in a file io function. The number should be retrieved before any other OS calls (because they may @@ -511,7 +548,7 @@ os_file_get_last_error( "InnoDB: The error means mysqld does not have" " the access rights to\n" "InnoDB: the directory.\n"); - } else { + } else if (!os_diagnose_all_o_direct_einval(err)) { if (strerror((int)err) != NULL) { fprintf(stderr, "InnoDB: Error number %lu" @@ -2513,6 +2550,9 @@ os_file_pwrite( /* Handle partial writes and signal interruptions correctly */ for (ret = 0; ret < (ssize_t) n; ) { n_written = pwrite(file, buf, (ssize_t)n - ret, offs); + DBUG_EXECUTE_IF("xb_simulate_all_o_direct_write_failure", + n_written = -1; + errno = EINVAL;); if (n_written >= 0) { ret += n_written; offs += n_written; @@ -2702,6 +2742,10 @@ try_again: try_again: ret = os_file_pread(file, buf, n, offset, offset_high, trx); + DBUG_EXECUTE_IF("xb_simulate_all_o_direct_read_failure", + ret = -1; + errno = EINVAL;); + if ((ulint)ret == n) { return(TRUE); @@ -3066,6 +3110,8 @@ retry: "InnoDB: " REFMAN "operating-system-error-codes.html\n"); + os_diagnose_all_o_direct_einval(errno); + os_has_said_disk_full = TRUE; } -- cgit v1.2.1