summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-06-14 13:07:20 +0200
committerSergei Golubchik <serg@mariadb.org>2016-06-14 13:07:20 +0200
commit15acc9a444fc1aecf59d90f996fe888bc13da107 (patch)
treee6e225bd15ea5094658245ae5f218d939b143029
parent124d9069d9032b01dc26a42ac070410e23d81e69 (diff)
parentf54dcf1e8742e19d13ab7fb8b92ae6a179e67fe3 (diff)
downloadmariadb-git-bb-5.5-merge.tar.gz
Merge branch 'merge-xtradb-5.5' into 5.5bb-5.5-merge
5.5.49-37.9
-rw-r--r--storage/xtradb/dict/dict0crea.c4
-rw-r--r--storage/xtradb/handler/ha_innodb.cc2
-rw-r--r--storage/xtradb/include/os0sync.h47
-rw-r--r--storage/xtradb/include/univ.i4
-rw-r--r--storage/xtradb/log/log0recv.c4
-rw-r--r--storage/xtradb/os/os0file.c48
6 files changed, 77 insertions, 32 deletions
diff --git a/storage/xtradb/dict/dict0crea.c b/storage/xtradb/dict/dict0crea.c
index 4c1c4f1bd6b..a77acf8b577 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 8148c3e1dd5..8958c0cf32b 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -12883,7 +12883,7 @@ innodb_buffer_pool_evict_update(
mutex_enter(&block->mutex);
ut_ad(mutex_own(&buf_pool->LRU_list_mutex));
buf_LRU_free_block(&block->page,
- FALSE, TRUE);
+ FALSE, TRUE);
mutex_exit(&block->mutex);
block = prev_block;
}
diff --git a/storage/xtradb/include/os0sync.h b/storage/xtradb/include/os0sync.h
index a60dcbd1e75..b52c078fa54 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__ */
@@ -369,28 +368,7 @@ Returns the old value of *ptr, atomically sets *ptr to new_val */
# define os_atomic_test_and_set_byte_acquire(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
@@ -419,6 +397,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 aced1fde229..2aaabf64a4e 100644
--- a/storage/xtradb/include/univ.i
+++ b/storage/xtradb/include/univ.i
@@ -64,10 +64,10 @@ 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 "5.5.48-MariaDB-" IB_TO_STR(PERCONA_INNODB_VERSION)
+#define INNODB_VERSION_STR "5.5.49-MariaDB-" IB_TO_STR(PERCONA_INNODB_VERSION)
#define REFMAN "http://dev.mysql.com/doc/refman/" \
IB_TO_STR(MYSQL_MAJOR_VERSION) "." \
diff --git a/storage/xtradb/log/log0recv.c b/storage/xtradb/log/log0recv.c
index b0b481b0094..479f50d1931 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
@@ -1844,7 +1844,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 8870f823db3..cca5ffa4772 100644
--- a/storage/xtradb/os/os0file.c
+++ b/storage/xtradb/os/os0file.c
@@ -472,6 +472,43 @@ PIMAGE_TLS_CALLBACK p_thread_callback_base = win_tls_thread_exit;
#endif /*_WIN32 */
/***********************************************************************//**
+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
overwrite the error number). If the number is not known to this program,
@@ -596,7 +633,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"
@@ -2622,6 +2659,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;
@@ -2787,6 +2827,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);
@@ -3084,6 +3128,8 @@ retry:
"InnoDB: "
REFMAN "operating-system-error-codes.html\n");
+ os_diagnose_all_o_direct_einval(errno);
+
os_has_said_disk_full = TRUE;
}