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

MDEV-12173 "Error: trying to do an operation on a dropped tablespace"

InnoDB is issuing a 'noise' message that is not a sign of abnormal
operation. The only issuers of it are the debug function
lock_rec_block_validate() and the change buffer merge.
While the error should ideally never occur in transactional locking,
we happen to know that DISCARD TABLESPACE and TRUNCATE TABLE and
possibly DROP TABLE are breaking InnoDB table locks.

When it comes to the change buffer merge, the message simply is useless
noise. We know perfectly well that a tablespace can be dropped while a
change buffer merge is pending. And the code is prepared to handle that,
which is demonstrated by the fact that whenever the message was issued,
InnoDB did not crash.

fil_inc_pending_ops(): Remove the parameter print_err.
parent 5e87f49a
......@@ -1965,8 +1965,7 @@ UNIV_INTERN
ibool
fil_inc_pending_ops(
/*================*/
ulint id, /*!< in: space id */
ibool print_err) /*!< in: need to print error or not */
ulint id) /*!< in: space id */
{
fil_space_t* space;
......@@ -1974,15 +1973,6 @@ fil_inc_pending_ops(
space = fil_space_get_by_id(id);
if (space == NULL) {
if (print_err) {
fprintf(stderr,
"InnoDB: Error: trying to do an operation on a"
" dropped tablespace %lu\n",
(ulong) id);
}
}
if (space == NULL || space->stop_new_ops) {
mutex_exit(&fil_system->mutex);
......
/*****************************************************************************
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
Copyright (c) 2017, 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
......@@ -4575,7 +4575,7 @@ ibuf_merge_or_delete_for_page(
function. When the counter is > 0, that prevents tablespace
from being dropped. */
tablespace_being_deleted = fil_inc_pending_ops(space, true);
tablespace_being_deleted = fil_inc_pending_ops(space);
if (UNIV_UNLIKELY(tablespace_being_deleted)) {
/* Do not try to read the bitmap page from space;
......
/*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. All Rights Reserved.
Copyright (c) 2017, 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
......@@ -593,8 +593,7 @@ UNIV_INTERN
ibool
fil_inc_pending_ops(
/*================*/
ulint id, /*!< in: space id */
ibool print_err); /*!< in: need to print error or not */
ulint id); /*!< in: space id */
/*******************************************************************//**
Decrements the count of pending operations. */
UNIV_INTERN
......
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2014, 2016, 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
......@@ -5544,7 +5544,6 @@ lock_print_info_all_transactions(
ulint space = lock->un_member.rec_lock.space;
ulint zip_size= fil_space_get_zip_size(space);
ulint page_no = lock->un_member.rec_lock.page_no;
ibool tablespace_being_deleted = FALSE;
if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) {
......@@ -5567,9 +5566,7 @@ lock_print_info_all_transactions(
/* Check if the space is exists or not. only when the space
is valid, try to get the page. */
tablespace_being_deleted = fil_inc_pending_ops(space, false);
if (!tablespace_being_deleted) {
if (!fil_inc_pending_ops(space)) {
mtr_start(&mtr);
buf_page_get_gen(space, zip_size, page_no,
......@@ -6007,7 +6004,7 @@ lock_rec_block_validate(
/* Make sure that the tablespace is not deleted while we are
trying to access the page. */
if (!fil_inc_pending_ops(space, true)) {
if (!fil_inc_pending_ops(space)) {
mtr_start(&mtr);
block = buf_page_get_gen(
space, fil_space_get_zip_size(space),
......
......@@ -2012,8 +2012,7 @@ UNIV_INTERN
ibool
fil_inc_pending_ops(
/*================*/
ulint id, /*!< in: space id */
ibool print_err) /*!< in: need to print error or not */
ulint id) /*!< in: space id */
{
fil_space_t* space;
......@@ -2021,15 +2020,6 @@ fil_inc_pending_ops(
space = fil_space_get_by_id(id);
if (space == NULL) {
if (print_err) {
fprintf(stderr,
"InnoDB: Error: trying to do an operation on a"
" dropped tablespace %lu\n",
(ulong) id);
}
}
if (space == NULL || space->stop_new_ops) {
mutex_exit(&fil_system->mutex);
......
/*****************************************************************************
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
Copyright (c) 2017, 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
......@@ -4617,7 +4617,7 @@ ibuf_merge_or_delete_for_page(
function. When the counter is > 0, that prevents tablespace
from being dropped. */
tablespace_being_deleted = fil_inc_pending_ops(space, true);
tablespace_being_deleted = fil_inc_pending_ops(space);
if (UNIV_UNLIKELY(tablespace_being_deleted)) {
/* Do not try to read the bitmap page from space;
......
/*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. All Rights Reserved.
Copyright (c) 2017, 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
......@@ -589,8 +589,7 @@ UNIV_INTERN
ibool
fil_inc_pending_ops(
/*================*/
ulint id, /*!< in: space id */
ibool print_err); /*!< in: need to print error or not */
ulint id); /*!< in: space id */
/*******************************************************************//**
Decrements the count of pending operations. */
UNIV_INTERN
......
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2014, 2015, 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
......@@ -5592,7 +5592,6 @@ lock_print_info_all_transactions(
ulint space = lock->un_member.rec_lock.space;
ulint zip_size= fil_space_get_zip_size(space);
ulint page_no = lock->un_member.rec_lock.page_no;
ibool tablespace_being_deleted = FALSE;
if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) {
......@@ -5617,10 +5616,7 @@ lock_print_info_all_transactions(
/* Check if the space is exists or not. only
when the space is valid, try to get the page. */
tablespace_being_deleted
= fil_inc_pending_ops(space, false);
if (!tablespace_being_deleted) {
if (!fil_inc_pending_ops(space)) {
mtr_start(&mtr);
buf_page_get_gen(space, zip_size,
......@@ -6065,7 +6061,7 @@ lock_rec_block_validate(
/* Make sure that the tablespace is not deleted while we are
trying to access the page. */
if (!fil_inc_pending_ops(space, true)) {
if (!fil_inc_pending_ops(space)) {
mtr_start(&mtr);
block = buf_page_get_gen(
space, fil_space_get_zip_size(space),
......
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