Commit f69a3b2e authored by Marko Mäkelä's avatar Marko Mäkelä

After-merge fix for commit d4df7bc9

The merge omitted some InnoDB and XtraDB conflict resolutions,
most notably, failing to merge the fix of MDEV-12173.

ibuf_merge_or_delete_for_page(), lock_rec_block_validate():
Invoke fil_space_acquire_silent() instead of fil_space_acquire().
This fixes MDEV-12173.

wsrep_debug, wsrep_trx_is_aborting(): Removed unused declarations.

_fil_io(): Remove. Instead, declare default parameters for the XtraDB
fil_io().

buf_read_page_low(): Declare default parameters, and clean up some
callers.

os_aio(): Correct the macro that is defined when !UNIV_PFS_IO.
parent f694df6a
...@@ -4603,7 +4603,7 @@ ibuf_merge_or_delete_for_page( ...@@ -4603,7 +4603,7 @@ ibuf_merge_or_delete_for_page(
function. When the counter is > 0, that prevents tablespace function. When the counter is > 0, that prevents tablespace
from being dropped. */ from being dropped. */
space = fil_space_acquire(space_id); space = fil_space_acquire_silent(space_id);
if (UNIV_UNLIKELY(!space)) { if (UNIV_UNLIKELY(!space)) {
/* Do not try to read the bitmap page from space; /* Do not try to read the bitmap page from space;
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2014, 2018, MariaDB Corporation Copyright (c) 2014, 2018, MariaDB Corporation.
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
...@@ -6910,7 +6910,7 @@ lock_rec_block_validate( ...@@ -6910,7 +6910,7 @@ lock_rec_block_validate(
/* Make sure that the tablespace is not deleted while we are /* Make sure that the tablespace is not deleted while we are
trying to access the page. */ trying to access the page. */
if (fil_space_t* space = fil_space_acquire(space_id)) { if (fil_space_t* space = fil_space_acquire_silent(space_id)) {
mtr_start(&mtr); mtr_start(&mtr);
block = buf_page_get_gen( block = buf_page_get_gen(
......
...@@ -77,10 +77,6 @@ Created 10/8/1995 Heikki Tuuri ...@@ -77,10 +77,6 @@ Created 10/8/1995 Heikki Tuuri
#include "fil0pagecompress.h" #include "fil0pagecompress.h"
#include "btr0scrub.h" #include "btr0scrub.h"
#ifdef WITH_WSREP
extern int wsrep_debug;
extern int wsrep_trx_is_aborting(void *thd_ptr);
#endif
/* The following is the maximum allowed duration of a lock wait. */ /* The following is the maximum allowed duration of a lock wait. */
UNIV_INTERN ulong srv_fatal_semaphore_wait_threshold = DEFAULT_SRV_FATAL_SEMAPHORE_TIMEOUT; UNIV_INTERN ulong srv_fatal_semaphore_wait_threshold = DEFAULT_SRV_FATAL_SEMAPHORE_TIMEOUT;
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2017, MariaDB Corporation. Copyright (c) 2013, 2018, MariaDB Corporation.
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
...@@ -124,7 +124,12 @@ not exist or is being dropped ...@@ -124,7 +124,12 @@ not exist or is being dropped
use to stop dangling page reads from a tablespace use to stop dangling page reads from a tablespace
which we have DISCARDed + IMPORTed back which we have DISCARDed + IMPORTed back
@param[in] offset page number @param[in] offset page number
@param[in] trx transaction @param[in,out] trx transaction
@param[in] should_buffer whether to buffer an aio request.
AIO read ahead uses this. If you plan to
use this parameter, make sure you remember
to call os_aio_dispatch_read_array_submit()
when you're ready to commit all your requests
@return 1 if read request is issued. 0 if it is not */ @return 1 if read request is issued. 0 if it is not */
static static
ulint ulint
...@@ -137,12 +142,8 @@ buf_read_page_low( ...@@ -137,12 +142,8 @@ buf_read_page_low(
ibool unzip, ibool unzip,
ib_int64_t tablespace_version, ib_int64_t tablespace_version,
ulint offset, ulint offset,
trx_t* trx, trx_t* trx = NULL,
bool should_buffer) /*!< in: whether to buffer an aio request. bool should_buffer = false)
AIO read ahead uses this. If you plan to
use this parameter, make sure you remember
to call os_aio_dispatch_read_array_submit()
when you're ready to commit all your requests.*/
{ {
buf_page_t* bpage; buf_page_t* bpage;
ulint wake_later; ulint wake_later;
...@@ -245,18 +246,18 @@ buf_read_page_low( ...@@ -245,18 +246,18 @@ buf_read_page_low(
} }
if (zip_size) { if (zip_size) {
*err = _fil_io(OS_FILE_READ | wake_later *err = fil_io(OS_FILE_READ | wake_later
| ignore_nonexistent_pages, | ignore_nonexistent_pages,
sync, space, zip_size, offset, 0, zip_size, sync, space, zip_size, offset, 0, zip_size,
frame, bpage, 0, trx, should_buffer); frame, bpage, 0, trx, should_buffer);
} else { } else {
ut_a(buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE); ut_a(buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE);
*err = _fil_io(OS_FILE_READ | wake_later *err = fil_io(OS_FILE_READ | wake_later
| ignore_nonexistent_pages, | ignore_nonexistent_pages,
sync, space, 0, offset, 0, UNIV_PAGE_SIZE, sync, space, 0, offset, 0, UNIV_PAGE_SIZE,
frame, bpage, &bpage->write_size, trx, frame, bpage, &bpage->write_size,
should_buffer); trx, should_buffer);
} }
if (sync) { if (sync) {
...@@ -418,7 +419,7 @@ buf_read_ahead_random( ...@@ -418,7 +419,7 @@ buf_read_ahead_random(
&err, false, &err, false,
ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER, ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER,
space, zip_size, FALSE, space, zip_size, FALSE,
tablespace_version, i, trx, false); tablespace_version, i, trx);
switch(err) { switch(err) {
case DB_SUCCESS: case DB_SUCCESS:
...@@ -508,7 +509,7 @@ buf_read_page( ...@@ -508,7 +509,7 @@ buf_read_page(
switches: hence TRUE */ switches: hence TRUE */
count = buf_read_page_low(&err, true, BUF_READ_ANY_PAGE, space_id, count = buf_read_page_low(&err, true, BUF_READ_ANY_PAGE, space_id,
zip_size, FALSE, zip_size, FALSE,
tablespace_version, offset, trx, false); tablespace_version, offset, trx);
srv_stats.buf_pool_reads.add(count); srv_stats.buf_pool_reads.add(count);
} }
...@@ -561,7 +562,7 @@ buf_read_page_async( ...@@ -561,7 +562,7 @@ buf_read_page_async(
| OS_AIO_SIMULATED_WAKE_LATER | OS_AIO_SIMULATED_WAKE_LATER
| BUF_READ_IGNORE_NONEXISTENT_PAGES, | BUF_READ_IGNORE_NONEXISTENT_PAGES,
space, zip_size, FALSE, space, zip_size, FALSE,
tablespace_version, offset, NULL, false); tablespace_version, offset);
switch(err) { switch(err) {
case DB_SUCCESS: case DB_SUCCESS:
...@@ -959,7 +960,7 @@ buf_read_ibuf_merge_pages( ...@@ -959,7 +960,7 @@ buf_read_ibuf_merge_pages(
buf_read_page_low(&err, sync && (i + 1 == n_stored), buf_read_page_low(&err, sync && (i + 1 == n_stored),
BUF_READ_ANY_PAGE, space_ids[i], BUF_READ_ANY_PAGE, space_ids[i],
zip_size, TRUE, space_versions[i], zip_size, TRUE, space_versions[i],
page_nos[i], NULL, false); page_nos[i]);
switch(err) { switch(err) {
case DB_SUCCESS: case DB_SUCCESS:
...@@ -1107,13 +1108,12 @@ buf_read_recv_pages( ...@@ -1107,13 +1108,12 @@ buf_read_recv_pages(
if ((i + 1 == n_stored) && sync) { if ((i + 1 == n_stored) && sync) {
buf_read_page_low(&err, true, BUF_READ_ANY_PAGE, space, buf_read_page_low(&err, true, BUF_READ_ANY_PAGE, space,
zip_size, TRUE, tablespace_version, zip_size, TRUE, tablespace_version,
page_nos[i], NULL, false); page_nos[i]);
} else { } else {
buf_read_page_low(&err, false, BUF_READ_ANY_PAGE buf_read_page_low(&err, false, BUF_READ_ANY_PAGE
| OS_AIO_SIMULATED_WAKE_LATER, | OS_AIO_SIMULATED_WAKE_LATER,
space, zip_size, TRUE, space, zip_size, TRUE,
tablespace_version, page_nos[i], tablespace_version, page_nos[i]);
NULL, false);
} }
if (err == DB_DECRYPTION_FAILED) { if (err == DB_DECRYPTION_FAILED) {
......
...@@ -6061,7 +6061,7 @@ Reads or writes data. This operation is asynchronous (aio). ...@@ -6061,7 +6061,7 @@ Reads or writes data. This operation is asynchronous (aio).
i/o on a tablespace which does not exist */ i/o on a tablespace which does not exist */
UNIV_INTERN UNIV_INTERN
dberr_t dberr_t
_fil_io( fil_io(
/*===*/ /*===*/
ulint type, /*!< in: OS_FILE_READ or OS_FILE_WRITE, ulint type, /*!< in: OS_FILE_READ or OS_FILE_WRITE,
ORed to OS_FILE_LOG, if a log i/o ORed to OS_FILE_LOG, if a log i/o
...@@ -6318,8 +6318,8 @@ _fil_io( ...@@ -6318,8 +6318,8 @@ _fil_io(
/* Queue the aio request */ /* Queue the aio request */
ret = os_aio(type, is_log, mode | wake_later, name, node->handle, buf, ret = os_aio(type, is_log, mode | wake_later, name, node->handle, buf,
offset, len, zip_size ? zip_size : UNIV_PAGE_SIZE, node, offset, len, zip_size ? zip_size : UNIV_PAGE_SIZE, node,
message, space_id, trx, write_size, should_buffer); message, space_id, trx, write_size, should_buffer);
#else #else
/* In mysqlbackup do normal i/o, not aio */ /* In mysqlbackup do normal i/o, not aio */
......
...@@ -4645,7 +4645,7 @@ ibuf_merge_or_delete_for_page( ...@@ -4645,7 +4645,7 @@ ibuf_merge_or_delete_for_page(
function. When the counter is > 0, that prevents tablespace function. When the counter is > 0, that prevents tablespace
from being dropped. */ from being dropped. */
space = fil_space_acquire(space_id); space = fil_space_acquire_silent(space_id);
if (UNIV_UNLIKELY(!space)) { if (UNIV_UNLIKELY(!space)) {
/* Do not try to read the bitmap page from space; /* Do not try to read the bitmap page from space;
......
...@@ -1161,7 +1161,7 @@ Reads or writes data. This operation is asynchronous (aio). ...@@ -1161,7 +1161,7 @@ Reads or writes data. This operation is asynchronous (aio).
i/o on a tablespace which does not exist */ i/o on a tablespace which does not exist */
UNIV_INTERN UNIV_INTERN
dberr_t dberr_t
_fil_io( fil_io(
/*===*/ /*===*/
ulint type, /*!< in: OS_FILE_READ or OS_FILE_WRITE, ulint type, /*!< in: OS_FILE_READ or OS_FILE_WRITE,
ORed to OS_FILE_LOG, if a log i/o ORed to OS_FILE_LOG, if a log i/o
...@@ -1189,18 +1189,18 @@ _fil_io( ...@@ -1189,18 +1189,18 @@ _fil_io(
void* message, /*!< in: message for aio handler if non-sync void* message, /*!< in: message for aio handler if non-sync
aio used, else ignored */ aio used, else ignored */
ulint* write_size, /*!< in/out: Actual write size initialized ulint* write_size, /*!< in/out: Actual write size initialized
after fist successfull trim after fist successfull trim
operation for this page and if operation for this page and if
initialized we do not trim again if initialized we do not trim again if
actual page size does not decrease. */ actual page size does not decrease. */
trx_t* trx, /*!< in: trx */ trx_t* trx = NULL, /*!< in: trx */
bool should_buffer) /*!< in: whether to buffer an aio request. bool should_buffer = false)
Only used by aio read ahead*/ /*!< in: whether to buffer an aio request.
AIO read ahead uses this. If you plan to
__attribute__((nonnull(8))); use this parameter, make sure you remember
to call os_aio_dispatch_read_array_submit()
#define fil_io(type, sync, space_id, zip_size, block_offset, byte_offset, len, buf, message, write_size) \ when you're ready to commit all your requests.*/
_fil_io(type, sync, space_id, zip_size, block_offset, byte_offset, len, buf, message, write_size, NULL, false) MY_ATTRIBUTE((nonnull(8)));
/** Determine the block size of the data file. /** Determine the block size of the data file.
@param[in] space tablespace @param[in] space tablespace
......
...@@ -382,11 +382,12 @@ The wrapper functions have the prefix of "innodb_". */ ...@@ -382,11 +382,12 @@ The wrapper functions have the prefix of "innodb_". */
pfs_os_file_close_no_error_handling_func(file, __FILE__, __LINE__) pfs_os_file_close_no_error_handling_func(file, __FILE__, __LINE__)
# define os_aio(type, is_log, mode, name, file, buf, offset, \ # define os_aio(type, is_log, mode, name, file, buf, offset, \
n, page_size, message1, message2, space_id, \ n, page_size, message1, message2, space_id, \
trx, write_size, should_buffer) \ trx, write_size, should_buffer) \
pfs_os_aio_func(type, is_log, mode, name, file, buf, offset, \ pfs_os_aio_func(type, is_log, mode, name, file, buf, offset, \
n, page_size, message1, message2, space_id, trx, write_size, \ n, page_size, message1, message2, space_id, \
should_buffer, __FILE__, __LINE__) trx, write_size, should_buffer, \
__FILE__, __LINE__)
# define os_file_read(file, buf, offset, n) \ # define os_file_read(file, buf, offset, n) \
pfs_os_file_read_func(file, buf, offset, n, NULL, \ pfs_os_file_read_func(file, buf, offset, n, NULL, \
...@@ -454,10 +455,12 @@ to original un-instrumented file I/O APIs */ ...@@ -454,10 +455,12 @@ to original un-instrumented file I/O APIs */
# define os_file_close_no_error_handling(file) \ # define os_file_close_no_error_handling(file) \
os_file_close_no_error_handling_func(file) os_file_close_no_error_handling_func(file)
# define os_aio(type, is_log, mode, name, file, buf, offset, n, page_size, message1, \ # define os_aio(type, is_log, mode, name, file, buf, offset, \
message2, space_id, trx, write_size) \ n, page_size, message1, \
message2, space_id, trx, write_size, should_buffer) \
os_aio_func(type, is_log, mode, name, file, buf, offset, n, \ os_aio_func(type, is_log, mode, name, file, buf, offset, n, \
page_size, message1, message2, space_id, trx, write_size, should_buffer) page_size, message1, message2, space_id, \
trx, write_size, should_buffer)
# define os_file_read(file, buf, offset, n) \ # define os_file_read(file, buf, offset, n) \
os_file_read_func(file, buf, offset, n, NULL) os_file_read_func(file, buf, offset, n, NULL)
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2014, 2018, MariaDB Corporation Copyright (c) 2014, 2018, MariaDB Corporation.
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
...@@ -6970,7 +6970,7 @@ lock_rec_block_validate( ...@@ -6970,7 +6970,7 @@ lock_rec_block_validate(
/* Make sure that the tablespace is not deleted while we are /* Make sure that the tablespace is not deleted while we are
trying to access the page. */ trying to access the page. */
if (fil_space_t* space = fil_space_acquire(space_id)) { if (fil_space_t* space = fil_space_acquire_silent(space_id)) {
mtr_start(&mtr); mtr_start(&mtr);
block = buf_page_get_gen( block = buf_page_get_gen(
......
...@@ -82,9 +82,6 @@ Created 10/8/1995 Heikki Tuuri ...@@ -82,9 +82,6 @@ Created 10/8/1995 Heikki Tuuri
/* prototypes for new functions added to ha_innodb.cc */ /* prototypes for new functions added to ha_innodb.cc */
ibool innobase_get_slow_log(); ibool innobase_get_slow_log();
#ifdef WITH_WSREP
extern int wsrep_trx_is_aborting(void *thd_ptr);
#endif
/* The following counter is incremented whenever there is some user activity /* The following counter is incremented whenever there is some user activity
in the server */ in the server */
UNIV_INTERN ulint srv_activity_count = 0; UNIV_INTERN ulint srv_activity_count = 0;
......
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