Commit f54dcf1e authored by Sergei Golubchik's avatar Sergei Golubchik

5.5.49-37.9

parent c9e56d5c
/*****************************************************************************
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) {
......
......@@ -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;
}
......
/*****************************************************************************
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"
......
......@@ -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
......
/*****************************************************************************
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 @@ recv_apply_hashed_log_recs(
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;
......
......@@ -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 @@ os_file_read_func(
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 @@ os_file_write_func(
"InnoDB: "
REFMAN "operating-system-error-codes.html\n");
os_diagnose_all_o_direct_einval(errno);
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