Skip to content

Commit f54dcf1

Browse files
committed
5.5.49-37.9
1 parent c9e56d5 commit f54dcf1

File tree

6 files changed

+76
-31
lines changed

6 files changed

+76
-31
lines changed

storage/xtradb/dict/dict0crea.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
the terms of the GNU General Public License as published by the Free Software
@@ -1255,7 +1255,7 @@ dict_create_index_step(
12551255
>= DICT_TF_FORMAT_ZIP);
12561256

12571257
node->index = dict_index_get_if_in_cache_low(index_id);
1258-
ut_a((node->index == 0) == (err != DB_SUCCESS));
1258+
ut_a((node->index == NULL) == (err != DB_SUCCESS));
12591259

12601260
if (err != DB_SUCCESS) {
12611261

storage/xtradb/handler/ha_innodb.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12605,7 +12605,7 @@ innodb_buffer_pool_evict_update(
1260512605

1260612606
mutex_enter(&block->mutex);
1260712607
buf_LRU_free_block(&block->page,
12608-
FALSE, FALSE);
12608+
FALSE, TRUE);
1260912609
mutex_exit(&block->mutex);
1261012610
block = prev_block;
1261112611
}

storage/xtradb/include/os0sync.h

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
44
Copyright (c) 2008, Google Inc.
55
66
Portions of this file contain modifications contributed and copyrighted by
@@ -41,7 +41,6 @@ Created 9/6/1995 Heikki Tuuri
4141
|| defined _M_X64 || defined __WIN__
4242

4343
#define IB_STRONG_MEMORY_MODEL
44-
#undef HAVE_IB_GCC_ATOMIC_TEST_AND_SET // Quick-and-dirty fix for bug 1519094
4544

4645
#endif /* __i386__ || __x86_64__ || _M_IX86 || M_X64 || __WIN__ */
4746

@@ -332,28 +331,7 @@ Returns the old value of *ptr, atomically sets *ptr to new_val */
332331
# define os_atomic_test_and_set_byte(ptr, new_val) \
333332
__sync_lock_test_and_set(ptr, (byte) new_val)
334333

335-
# if defined(HAVE_IB_GCC_ATOMIC_TEST_AND_SET)
336-
337-
/** Do an atomic test-and-set.
338-
@param[in,out] ptr Memory location to set to non-zero
339-
@return the previous value */
340-
static inline
341-
lock_word_t
342-
os_atomic_test_and_set(volatile lock_word_t* ptr)
343-
{
344-
return(__atomic_test_and_set(ptr, __ATOMIC_ACQUIRE));
345-
}
346-
347-
/** Do an atomic clear.
348-
@param[in,out] ptr Memory location to set to zero */
349-
static inline
350-
void
351-
os_atomic_clear(volatile lock_word_t* ptr)
352-
{
353-
__atomic_clear(ptr, __ATOMIC_RELEASE);
354-
}
355-
356-
# elif defined(IB_STRONG_MEMORY_MODEL)
334+
# if defined(IB_STRONG_MEMORY_MODEL)
357335

358336
/** Do an atomic test and set.
359337
@param[in,out] ptr Memory location to set to non-zero
@@ -382,6 +360,27 @@ os_atomic_clear(volatile lock_word_t* ptr)
382360
return(__sync_lock_test_and_set(ptr, 0));
383361
}
384362

363+
# elif defined(HAVE_IB_GCC_ATOMIC_TEST_AND_SET)
364+
365+
/** Do an atomic test-and-set.
366+
@param[in,out] ptr Memory location to set to non-zero
367+
@return the previous value */
368+
static inline
369+
lock_word_t
370+
os_atomic_test_and_set(volatile lock_word_t* ptr)
371+
{
372+
return(__atomic_test_and_set(ptr, __ATOMIC_ACQUIRE));
373+
}
374+
375+
/** Do an atomic clear.
376+
@param[in,out] ptr Memory location to set to zero */
377+
static inline
378+
void
379+
os_atomic_clear(volatile lock_word_t* ptr)
380+
{
381+
__atomic_clear(ptr, __ATOMIC_RELEASE);
382+
}
383+
385384
# else
386385

387386
# error "Unsupported platform"

storage/xtradb/include/univ.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ component, i.e. we show M.N.P as M.N */
6464
(INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR)
6565

6666
#ifndef PERCONA_INNODB_VERSION
67-
#define PERCONA_INNODB_VERSION 37.8
67+
#define PERCONA_INNODB_VERSION 37.9
6868
#endif
6969

7070
#define INNODB_VERSION_STR MYSQL_SERVER_VERSION

storage/xtradb/log/log0recv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
the terms of the GNU General Public License as published by the Free Software
@@ -1837,7 +1837,7 @@ recv_apply_hashed_log_recs(
18371837
goto loop;
18381838
}
18391839

1840-
ut_ad((allow_ibuf == 0) == (mutex_own(&log_sys->mutex) != 0));
1840+
ut_ad((!allow_ibuf) == mutex_own(&log_sys->mutex));
18411841

18421842
if (!allow_ibuf) {
18431843
recv_no_ibuf_operations = TRUE;

storage/xtradb/os/os0file.c

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,43 @@ os_get_os_version(void)
386386
}
387387
#endif /* __WIN__ */
388388

389+
/***********************************************************************//**
390+
For an EINVAL I/O error, prints a diagnostic message if innodb_flush_method
391+
== ALL_O_DIRECT.
392+
@return TRUE if the diagnostic message was printed
393+
@return FALSE if the diagnostic message does not apply */
394+
static
395+
ibool
396+
os_diagnose_all_o_direct_einval(
397+
/*============================*/
398+
ulint err) /*!< in: C error code */
399+
{
400+
if ((err == EINVAL)
401+
&& (srv_unix_file_flush_method == SRV_UNIX_ALL_O_DIRECT)) {
402+
fprintf(stderr,
403+
"InnoDB: The error might be caused by redo log I/O "
404+
"not satisfying innodb_flush_method=ALL_O_DIRECT "
405+
"requirements by the underlying file system.\n");
406+
if (srv_log_block_size != 512)
407+
fprintf(stderr,
408+
"InnoDB: This might be caused by an "
409+
"incompatible non-default "
410+
"innodb_log_block_size value %lu.\n",
411+
srv_log_block_size);
412+
fprintf(stderr,
413+
"InnoDB: Please file a bug at "
414+
"https://bugs.percona.com and include this error "
415+
"message, my.cnf settings, and information about the "
416+
"file system where the redo log resides.\n");
417+
fprintf(stderr,
418+
"InnoDB: A possible workaround is to change "
419+
"innodb_flush_method value to something else "
420+
"than ALL_O_DIRECT.\n");
421+
return(TRUE);
422+
}
423+
return(FALSE);
424+
}
425+
389426
/***********************************************************************//**
390427
Retrieves the last error number if an error occurs in a file io function.
391428
The number should be retrieved before any other OS calls (because they may
@@ -511,7 +548,7 @@ os_file_get_last_error(
511548
"InnoDB: The error means mysqld does not have"
512549
" the access rights to\n"
513550
"InnoDB: the directory.\n");
514-
} else {
551+
} else if (!os_diagnose_all_o_direct_einval(err)) {
515552
if (strerror((int)err) != NULL) {
516553
fprintf(stderr,
517554
"InnoDB: Error number %lu"
@@ -2513,6 +2550,9 @@ os_file_pwrite(
25132550
/* Handle partial writes and signal interruptions correctly */
25142551
for (ret = 0; ret < (ssize_t) n; ) {
25152552
n_written = pwrite(file, buf, (ssize_t)n - ret, offs);
2553+
DBUG_EXECUTE_IF("xb_simulate_all_o_direct_write_failure",
2554+
n_written = -1;
2555+
errno = EINVAL;);
25162556
if (n_written >= 0) {
25172557
ret += n_written;
25182558
offs += n_written;
@@ -2702,6 +2742,10 @@ os_file_read_func(
27022742
try_again:
27032743
ret = os_file_pread(file, buf, n, offset, offset_high, trx);
27042744

2745+
DBUG_EXECUTE_IF("xb_simulate_all_o_direct_read_failure",
2746+
ret = -1;
2747+
errno = EINVAL;);
2748+
27052749
if ((ulint)ret == n) {
27062750

27072751
return(TRUE);
@@ -3066,6 +3110,8 @@ os_file_write_func(
30663110
"InnoDB: "
30673111
REFMAN "operating-system-error-codes.html\n");
30683112

3113+
os_diagnose_all_o_direct_einval(errno);
3114+
30693115
os_has_said_disk_full = TRUE;
30703116
}
30713117

0 commit comments

Comments
 (0)