summaryrefslogtreecommitdiff
path: root/storage/xtradb/fil/fil0fil.c
diff options
context:
space:
mode:
Diffstat (limited to 'storage/xtradb/fil/fil0fil.c')
-rw-r--r--storage/xtradb/fil/fil0fil.c105
1 files changed, 27 insertions, 78 deletions
diff --git a/storage/xtradb/fil/fil0fil.c b/storage/xtradb/fil/fil0fil.c
index 397c4de4b6e..ff4e5b1b033 100644
--- a/storage/xtradb/fil/fil0fil.c
+++ b/storage/xtradb/fil/fil0fil.c
@@ -2426,15 +2426,11 @@ try_again:
To deal with potential read requests by checking the
::stop_new_ops flag in fil_io() */
- if (srv_lazy_drop_table) {
- buf_LRU_mark_space_was_deleted(id);
- } else {
buf_LRU_flush_or_remove_pages(
id, evict_all
? BUF_REMOVE_ALL_NO_WRITE
: BUF_REMOVE_FLUSH_NO_WRITE);
- }
#endif
/* printf("Deleting tablespace %s id %lu\n", space->name, id); */
@@ -5326,22 +5322,6 @@ _fil_io(
srv_data_written+= len;
}
- /* if the table space was already deleted, space might not exist already. */
- if (message
- && space_id < SRV_LOG_SPACE_FIRST_ID
- && ((buf_page_t*)message)->space_was_being_deleted) {
-
- if (mode == OS_AIO_NORMAL) {
- buf_page_io_complete(message);
- return(DB_SUCCESS); /*fake*/
- }
- if (type == OS_FILE_READ) {
- return(DB_TABLESPACE_DELETED);
- } else {
- return(DB_SUCCESS); /*fake*/
- }
- }
-
/* Reserve the fil_system mutex and make sure that we can open at
least one file while holding it, if the file is not already open */
@@ -5445,35 +5425,38 @@ _fil_io(
ut_a(byte_offset % OS_MIN_LOG_BLOCK_SIZE == 0);
ut_a((len % OS_MIN_LOG_BLOCK_SIZE) == 0);
- if (srv_pass_corrupt_table == 1 && space->is_corrupt) {
+#ifndef UNIV_HOTBACKUP
+ if (UNIV_UNLIKELY(space->is_corrupt && srv_pass_corrupt_table)) {
+
/* should ignore i/o for the crashed space */
- mutex_enter(&fil_system->mutex);
- fil_node_complete_io(node, fil_system, type);
- mutex_exit(&fil_system->mutex);
- if (mode == OS_AIO_NORMAL) {
- ut_a(space->purpose == FIL_TABLESPACE);
- buf_page_io_complete(message);
+ if (srv_pass_corrupt_table == 1 ||
+ type == OS_FILE_WRITE) {
+
+ mutex_enter(&fil_system->mutex);
+ fil_node_complete_io(node, fil_system, type);
+ mutex_exit(&fil_system->mutex);
+ if (mode == OS_AIO_NORMAL) {
+ ut_a(space->purpose == FIL_TABLESPACE);
+ buf_page_io_complete(message);
+ }
}
- if (type == OS_FILE_READ) {
+
+ if (srv_pass_corrupt_table == 1 && type == OS_FILE_READ) {
+
return(DB_TABLESPACE_DELETED);
- } else {
+
+ } else if (type == OS_FILE_WRITE) {
+
return(DB_SUCCESS);
}
- } else {
- if (srv_pass_corrupt_table > 1 && space->is_corrupt) {
- /* should ignore write i/o for the crashed space */
- if (type == OS_FILE_WRITE) {
- mutex_enter(&fil_system->mutex);
- fil_node_complete_io(node, fil_system, type);
- mutex_exit(&fil_system->mutex);
- if (mode == OS_AIO_NORMAL) {
- ut_a(space->purpose == FIL_TABLESPACE);
- buf_page_io_complete(message);
- }
- return(DB_SUCCESS);
- }
- }
-#ifdef UNIV_HOTBACKUP
+ } /**/
+
+ /* Queue the aio request */
+ ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,
+ offset_low, offset_high, len, node, message, space_id,
+ trx);
+
+#else
/* In ibbackup do normal i/o, not aio */
if (type == OS_FILE_READ) {
ret = os_file_read(node->handle, buf, offset_low, offset_high,
@@ -5482,26 +5465,7 @@ _fil_io(
ret = os_file_write(node->name, node->handle, buf,
offset_low, offset_high, len);
}
-#else
- /* Queue the aio request */
- ret = os_aio(type, mode | wake_later, node->name, node->handle, buf,
- offset_low, offset_high, len, node, message, space_id, trx);
#endif
- } /**/
-
- /* if the table space was already deleted, space might not exist already. */
- if (message
- && space_id < SRV_LOG_SPACE_FIRST_ID
- && ((buf_page_t*)message)->space_was_being_deleted) {
-
- if (mode == OS_AIO_SYNC) {
- if (type == OS_FILE_READ) {
- return(DB_TABLESPACE_DELETED);
- } else {
- return(DB_SUCCESS); /*fake*/
- }
- }
- }
ut_a(ret);
@@ -5625,21 +5589,6 @@ fil_aio_wait(
&message, &type, &space_id);
}
- /* if the table space was already deleted, fil_node might not exist already. */
- if (message
- && space_id < SRV_LOG_SPACE_FIRST_ID
- && ((buf_page_t*)message)->space_was_being_deleted) {
-
- /* intended not to be uncompress read page */
- ut_a(buf_page_get_io_fix_unlocked(message) == BUF_IO_WRITE
- || !buf_page_get_zip_size(message)
- || buf_page_get_state(message) != BUF_BLOCK_FILE_PAGE);
-
- srv_set_io_thread_op_info(segment, "complete io for buf page");
- buf_page_io_complete(message);
- return;
- }
-
ut_a(ret);
if (UNIV_UNLIKELY(fil_node == NULL)) {
ut_ad(srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS);