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(
function. When the counter is > 0, that prevents tablespace
from being dropped. */
space = fil_space_acquire(space_id);
space = fil_space_acquire_silent(space_id);
if (UNIV_UNLIKELY(!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) 2014, 2018, MariaDB Corporation
Copyright (c) 2014, 2018, MariaDB Corporation.
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
......@@ -6910,7 +6910,7 @@ lock_rec_block_validate(
/* Make sure that the tablespace is not deleted while we are
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);
block = buf_page_get_gen(
......
......@@ -77,10 +77,6 @@ Created 10/8/1995 Heikki Tuuri
#include "fil0pagecompress.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. */
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) 2013, 2017, MariaDB Corporation.
Copyright (c) 2013, 2018, MariaDB Corporation.
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
......@@ -124,7 +124,12 @@ not exist or is being dropped
use to stop dangling page reads from a tablespace
which we have DISCARDed + IMPORTed back
@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 */
static
ulint
......@@ -137,12 +142,8 @@ buf_read_page_low(
ibool unzip,
ib_int64_t tablespace_version,
ulint offset,
trx_t* trx,
bool should_buffer) /*!< in: 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.*/
trx_t* trx = NULL,
bool should_buffer = false)
{
buf_page_t* bpage;
ulint wake_later;
......@@ -245,18 +246,18 @@ buf_read_page_low(
}
if (zip_size) {
*err = _fil_io(OS_FILE_READ | wake_later
*err = fil_io(OS_FILE_READ | wake_later
| ignore_nonexistent_pages,
sync, space, zip_size, offset, 0, zip_size,
frame, bpage, 0, trx, should_buffer);
} else {
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,
sync, space, 0, offset, 0, UNIV_PAGE_SIZE,
frame, bpage, &bpage->write_size, trx,
should_buffer);
frame, bpage, &bpage->write_size,
trx, should_buffer);
}
if (sync) {
......@@ -418,7 +419,7 @@ buf_read_ahead_random(
&err, false,
ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER,
space, zip_size, FALSE,
tablespace_version, i, trx, false);
tablespace_version, i, trx);
switch(err) {
case DB_SUCCESS:
......@@ -508,7 +509,7 @@ buf_read_page(
switches: hence TRUE */
count = buf_read_page_low(&err, true, BUF_READ_ANY_PAGE, space_id,
zip_size, FALSE,
tablespace_version, offset, trx, false);
tablespace_version, offset, trx);
srv_stats.buf_pool_reads.add(count);
}
......@@ -561,7 +562,7 @@ buf_read_page_async(
| OS_AIO_SIMULATED_WAKE_LATER
| BUF_READ_IGNORE_NONEXISTENT_PAGES,
space, zip_size, FALSE,
tablespace_version, offset, NULL, false);
tablespace_version, offset);
switch(err) {
case DB_SUCCESS:
......@@ -959,7 +960,7 @@ buf_read_ibuf_merge_pages(
buf_read_page_low(&err, sync && (i + 1 == n_stored),
BUF_READ_ANY_PAGE, space_ids[i],
zip_size, TRUE, space_versions[i],
page_nos[i], NULL, false);
page_nos[i]);
switch(err) {
case DB_SUCCESS:
......@@ -1107,13 +1108,12 @@ buf_read_recv_pages(
if ((i + 1 == n_stored) && sync) {
buf_read_page_low(&err, true, BUF_READ_ANY_PAGE, space,
zip_size, TRUE, tablespace_version,
page_nos[i], NULL, false);
page_nos[i]);
} else {
buf_read_page_low(&err, false, BUF_READ_ANY_PAGE
| OS_AIO_SIMULATED_WAKE_LATER,
space, zip_size, TRUE,
tablespace_version, page_nos[i],
NULL, false);
tablespace_version, page_nos[i]);
}
if (err == DB_DECRYPTION_FAILED) {
......
......@@ -6061,7 +6061,7 @@ Reads or writes data. This operation is asynchronous (aio).
i/o on a tablespace which does not exist */
UNIV_INTERN
dberr_t
_fil_io(
fil_io(
/*===*/
ulint type, /*!< in: OS_FILE_READ or OS_FILE_WRITE,
ORed to OS_FILE_LOG, if a log i/o
......
......@@ -4645,7 +4645,7 @@ ibuf_merge_or_delete_for_page(
function. When the counter is > 0, that prevents tablespace
from being dropped. */
space = fil_space_acquire(space_id);
space = fil_space_acquire_silent(space_id);
if (UNIV_UNLIKELY(!space)) {
/* Do not try to read the bitmap page from space;
......
......@@ -1161,7 +1161,7 @@ Reads or writes data. This operation is asynchronous (aio).
i/o on a tablespace which does not exist */
UNIV_INTERN
dberr_t
_fil_io(
fil_io(
/*===*/
ulint type, /*!< in: OS_FILE_READ or OS_FILE_WRITE,
ORed to OS_FILE_LOG, if a log i/o
......@@ -1193,14 +1193,14 @@ _fil_io(
operation for this page and if
initialized we do not trim again if
actual page size does not decrease. */
trx_t* trx, /*!< in: trx */
bool should_buffer) /*!< in: whether to buffer an aio request.
Only used by aio read ahead*/
__attribute__((nonnull(8)));
#define fil_io(type, sync, space_id, zip_size, block_offset, byte_offset, len, buf, message, write_size) \
_fil_io(type, sync, space_id, zip_size, block_offset, byte_offset, len, buf, message, write_size, NULL, false)
trx_t* trx = NULL, /*!< in: trx */
bool should_buffer = false)
/*!< in: 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.*/
MY_ATTRIBUTE((nonnull(8)));
/** Determine the block size of the data file.
@param[in] space tablespace
......
......@@ -385,8 +385,9 @@ The wrapper functions have the prefix of "innodb_". */
n, page_size, message1, message2, space_id, \
trx, write_size, should_buffer) \
pfs_os_aio_func(type, is_log, mode, name, file, buf, offset, \
n, page_size, message1, message2, space_id, trx, write_size, \
should_buffer, __FILE__, __LINE__)
n, page_size, message1, message2, space_id, \
trx, write_size, should_buffer, \
__FILE__, __LINE__)
# define os_file_read(file, buf, offset, n) \
pfs_os_file_read_func(file, buf, offset, n, NULL, \
......@@ -454,10 +455,12 @@ to original un-instrumented file I/O APIs */
# define os_file_close_no_error_handling(file) \
os_file_close_no_error_handling_func(file)
# define os_aio(type, is_log, mode, name, file, buf, offset, n, page_size, message1, \
message2, space_id, trx, write_size) \
# define os_aio(type, is_log, mode, name, file, buf, offset, \
n, page_size, message1, \
message2, space_id, trx, write_size, should_buffer) \
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) \
os_file_read_func(file, buf, offset, n, NULL)
......
/*****************************************************************************
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
the terms of the GNU General Public License as published by the Free Software
......@@ -6970,7 +6970,7 @@ lock_rec_block_validate(
/* Make sure that the tablespace is not deleted while we are
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);
block = buf_page_get_gen(
......
......@@ -82,9 +82,6 @@ Created 10/8/1995 Heikki Tuuri
/* prototypes for new functions added to ha_innodb.cc */
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
in the server */
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