Commit 260699e9 authored by Sergei Golubchik's avatar Sergei Golubchik

Merge branch 'merge-xtradb-5.5' into 5.5

parents 90eb3026 f54dcf1e
/***************************************************************************** /*****************************************************************************
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 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 the terms of the GNU General Public License as published by the Free Software
...@@ -1255,7 +1255,7 @@ dict_create_index_step( ...@@ -1255,7 +1255,7 @@ dict_create_index_step(
>= DICT_TF_FORMAT_ZIP); >= DICT_TF_FORMAT_ZIP);
node->index = dict_index_get_if_in_cache_low(index_id); 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) { if (err != DB_SUCCESS) {
......
/***************************************************************************** /*****************************************************************************
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. Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by Portions of this file contain modifications contributed and copyrighted by
...@@ -41,7 +41,6 @@ Created 9/6/1995 Heikki Tuuri ...@@ -41,7 +41,6 @@ Created 9/6/1995 Heikki Tuuri
|| defined _M_X64 || defined __WIN__ || defined _M_X64 || defined __WIN__
#define IB_STRONG_MEMORY_MODEL #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__ */ #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 */ ...@@ -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) \ # define os_atomic_test_and_set_byte_acquire(ptr, new_val) \
__sync_lock_test_and_set(ptr, (byte) new_val) __sync_lock_test_and_set(ptr, (byte) new_val)
# if defined(HAVE_IB_GCC_ATOMIC_TEST_AND_SET) # if defined(IB_STRONG_MEMORY_MODEL)
/** 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)
/** Do an atomic test and set. /** Do an atomic test and set.
@param[in,out] ptr Memory location to set to non-zero @param[in,out] ptr Memory location to set to non-zero
...@@ -419,6 +397,27 @@ os_atomic_clear(volatile lock_word_t* ptr) ...@@ -419,6 +397,27 @@ os_atomic_clear(volatile lock_word_t* ptr)
return(__sync_lock_test_and_set(ptr, 0)); 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 # else
# error "Unsupported platform" # error "Unsupported platform"
......
...@@ -64,10 +64,10 @@ component, i.e. we show M.N.P as M.N */ ...@@ -64,10 +64,10 @@ component, i.e. we show M.N.P as M.N */
(INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR) (INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR)
#ifndef PERCONA_INNODB_VERSION #ifndef PERCONA_INNODB_VERSION
#define PERCONA_INNODB_VERSION 37.8 #define PERCONA_INNODB_VERSION 37.9
#endif #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/" \ #define REFMAN "http://dev.mysql.com/doc/refman/" \
IB_TO_STR(MYSQL_MAJOR_VERSION) "." \ IB_TO_STR(MYSQL_MAJOR_VERSION) "." \
......
/***************************************************************************** /*****************************************************************************
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 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 the terms of the GNU General Public License as published by the Free Software
...@@ -1844,7 +1844,7 @@ loop: ...@@ -1844,7 +1844,7 @@ loop:
goto 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) { if (!allow_ibuf) {
recv_no_ibuf_operations = TRUE; recv_no_ibuf_operations = TRUE;
......
...@@ -471,6 +471,43 @@ PIMAGE_TLS_CALLBACK p_thread_callback_base = win_tls_thread_exit; ...@@ -471,6 +471,43 @@ PIMAGE_TLS_CALLBACK p_thread_callback_base = win_tls_thread_exit;
#endif #endif
#endif /*_WIN32 */ #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. 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 The number should be retrieved before any other OS calls (because they may
...@@ -596,7 +633,7 @@ os_file_get_last_error( ...@@ -596,7 +633,7 @@ os_file_get_last_error(
"InnoDB: The error means mysqld does not have" "InnoDB: The error means mysqld does not have"
" the access rights to\n" " the access rights to\n"
"InnoDB: the directory.\n"); "InnoDB: the directory.\n");
} else { } else if (!os_diagnose_all_o_direct_einval(err)) {
if (strerror((int)err) != NULL) { if (strerror((int)err) != NULL) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error number %lu" "InnoDB: Error number %lu"
...@@ -2622,6 +2659,9 @@ os_file_pwrite( ...@@ -2622,6 +2659,9 @@ os_file_pwrite(
/* Handle partial writes and signal interruptions correctly */ /* Handle partial writes and signal interruptions correctly */
for (ret = 0; ret < (ssize_t) n; ) { for (ret = 0; ret < (ssize_t) n; ) {
n_written = pwrite(file, buf, (ssize_t)n - ret, offs); 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) { if (n_written >= 0) {
ret += n_written; ret += n_written;
offs += n_written; offs += n_written;
...@@ -2787,6 +2827,10 @@ try_again: ...@@ -2787,6 +2827,10 @@ try_again:
try_again: try_again:
ret = os_file_pread(file, buf, n, offset, offset_high, trx); 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) { if ((ulint)ret == n) {
return(TRUE); return(TRUE);
...@@ -3084,6 +3128,8 @@ retry: ...@@ -3084,6 +3128,8 @@ retry:
"InnoDB: " "InnoDB: "
REFMAN "operating-system-error-codes.html\n"); REFMAN "operating-system-error-codes.html\n");
os_diagnose_all_o_direct_einval(errno);
os_has_said_disk_full = TRUE; os_has_said_disk_full = TRUE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment