diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-02-13 16:51:45 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-02-13 16:51:45 +0200 |
commit | 0c4aeef976d1094e90ce7a0b11138916e47c22fc (patch) | |
tree | 6ddf477556751c900dd75ee0fdd0ed80796cc3db /storage | |
parent | a778a62822709fe0e316831e6b474a4c749209f1 (diff) | |
parent | d9955b22e904bb70ec306eb319db9d501520cfef (diff) | |
download | mariadb-git-0c4aeef976d1094e90ce7a0b11138916e47c22fc.tar.gz |
Merge 10.2 into bb-10.2-ext
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/dict/dict0load.cc | 10 | ||||
-rw-r--r-- | storage/innobase/fil/fil0fil.cc | 9 | ||||
-rw-r--r-- | storage/innobase/fsp/fsp0file.cc | 6 | ||||
-rw-r--r-- | storage/innobase/fsp/fsp0sysspace.cc | 5 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 2 | ||||
-rw-r--r-- | storage/innobase/include/fsp0file.h | 3 | ||||
-rw-r--r-- | storage/innobase/lock/lock0lock.cc | 5 | ||||
-rw-r--r-- | storage/innobase/log/log0recv.cc | 4 | ||||
-rw-r--r-- | storage/innobase/os/os0file.cc | 4 | ||||
-rw-r--r-- | storage/innobase/trx/trx0trx.cc | 2 | ||||
-rw-r--r-- | storage/innobase/trx/trx0undo.cc | 4 | ||||
-rw-r--r-- | storage/xtradb/lock/lock0lock.cc | 5 | ||||
-rw-r--r-- | storage/xtradb/trx/trx0trx.cc | 4 | ||||
-rw-r--r-- | storage/xtradb/trx/trx0undo.cc | 6 |
14 files changed, 49 insertions, 20 deletions
diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index da838f83918..0ac5594fbc4 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2017, MariaDB Corporation. +Copyright (c) 2016, 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 @@ -1468,8 +1468,6 @@ dict_check_sys_tables( char* filepath = dict_get_first_path(space_id); /* Check that the .ibd file exists. */ - validate = true; /* Encryption */ - dberr_t err = fil_ibd_open( validate, !srv_read_only_mode && srv_log_file_size != 0, @@ -3074,6 +3072,12 @@ err_exit: } else { dict_mem_table_fill_foreign_vcol_set(table); table->fk_max_recusive_level = 0; + + if (table->space + && !fil_space_get_size(table->space)) { + table->corrupted = true; + table->file_unreadable = true; + } } } else { dict_index_t* index; diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 057aa37cabe..e778e086fec 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -624,6 +624,7 @@ retry: << " is only " << size_bytes << " bytes, should be at least " << min_size; os_file_close(node->handle); + node->handle = OS_FILE_CLOSED; return(false); } @@ -661,10 +662,12 @@ retry: ut_free(buf2); os_file_close(node->handle); + node->handle = OS_FILE_CLOSED; if (!fsp_flags_is_valid(flags, space->id)) { ulint cflags = fsp_flags_convert_from_101(flags); - if (cflags == ULINT_UNDEFINED) { + if (cflags == ULINT_UNDEFINED + || (cflags ^ space->flags) & ~FSP_FLAGS_MEM_MASK) { ib::error() << "Expected tablespace flags " << ib::hex(space->flags) @@ -4638,7 +4641,9 @@ fsp_flags_try_adjust(ulint space_id, ulint flags) { ut_ad(!srv_read_only_mode); ut_ad(fsp_flags_is_valid(flags, space_id)); - + if (!fil_space_get_size(space_id)) { + return; + } mtr_t mtr; mtr.start(); if (buf_block_t* b = buf_page_get( diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc index c21c9497735..eaadaad851d 100644 --- a/storage/innobase/fsp/fsp0file.cc +++ b/storage/innobase/fsp/fsp0file.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2013, 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 @@ -770,6 +770,10 @@ the double write buffer. bool Datafile::restore_from_doublewrite() { + if (srv_operation != SRV_OPERATION_NORMAL) { + return true; + } + /* Find if double write buffer contains page_no of given space id. */ const byte* page = recv_sys->dblwr.find_page(m_space_id, 0); const page_id_t page_id(m_space_id, 0); diff --git a/storage/innobase/fsp/fsp0sysspace.cc b/storage/innobase/fsp/fsp0sysspace.cc index c459c8296e0..e9f04cbd6c5 100644 --- a/storage/innobase/fsp/fsp0sysspace.cc +++ b/storage/innobase/fsp/fsp0sysspace.cc @@ -567,8 +567,9 @@ SysTablespace::read_lsn_and_check_flags(lsn_t* flushed_lsn) ut_a(it->order() == 0); - - buf_dblwr_init_or_load_pages(it->handle(), it->filepath()); + if (srv_operation == SRV_OPERATION_NORMAL) { + buf_dblwr_init_or_load_pages(it->handle(), it->filepath()); + } /* Check the contents of the first page of the first datafile. */ diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index de81a696eca..0baf8363598 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -18579,7 +18579,7 @@ innodb_make_page_dirty( return; } - if (srv_saved_page_number_debug > space->size) { + if (srv_saved_page_number_debug >= space->size) { fil_space_release(space); return; } diff --git a/storage/innobase/include/fsp0file.h b/storage/innobase/include/fsp0file.h index 1f057be0877..68e9f687fcd 100644 --- a/storage/innobase/include/fsp0file.h +++ b/storage/innobase/include/fsp0file.h @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 2013, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 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 @@ -363,7 +364,7 @@ private: @param[in] read_only_mode if true, then readonly mode checks are enforced. @return DB_SUCCESS or DB_IO_ERROR if page cannot be read */ - dberr_t read_first_page(bool read_first_page) + dberr_t read_first_page(bool read_only_mode) MY_ATTRIBUTE((warn_unused_result)); /** Free the first page from memory when it is no longer needed. */ diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index ca20a5033dc..d74ac76745d 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -7484,7 +7484,10 @@ lock_trx_release_locks( mutex_exit(&trx_sys->mutex); } else { - ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE)); + ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE) + || (trx_state_eq(trx, TRX_STATE_COMMITTED_IN_MEMORY) + && trx->is_recovered + && !UT_LIST_GET_LEN(trx->lock.trx_locks))); } bool release_lock; diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 821173d0f33..03304ed4dca 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -3147,7 +3147,9 @@ recv_init_crash_recovery_spaces() << "', but there were no modifications either."; } - buf_dblwr_process(); + if (srv_operation == SRV_OPERATION_NORMAL) { + buf_dblwr_process(); + } if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) { /* Spawn the background thread to flush dirty pages diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 51227696c1c..a824afc6e0e 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -2,7 +2,7 @@ Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Percona Inc. -Copyright (c) 2013, 2017, MariaDB Corporation. +Copyright (c) 2013, 2018, MariaDB Corporation. Portions of this file contain modifications contributed and copyrighted by Percona Inc.. Those modifications are @@ -4994,7 +4994,7 @@ os_file_write_func( if ((ulint) n_bytes != n && !os_has_said_disk_full) { ib::error() - << "Write to file " << name << "failed at offset " + << "Write to file " << name << " failed at offset " << offset << ", " << n << " bytes should have been written," " only " << n_bytes << " were written." diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index cc79a499c02..19614184507 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2017, MariaDB Corporation. +Copyright (c) 2015, 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 diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc index e3eb2595365..c93003f9e03 100644 --- a/storage/innobase/trx/trx0undo.cc +++ b/storage/innobase/trx/trx0undo.cc @@ -1793,7 +1793,9 @@ trx_undo_commit_cleanup(trx_undo_t* undo, bool is_temp) /* Delete first the undo log segment in the file */ mutex_exit(&rseg->mutex); - trx_undo_seg_free(undo, is_temp); + if (!srv_read_only_mode) { + trx_undo_seg_free(undo, is_temp); + } mutex_enter(&rseg->mutex); ut_ad(rseg->curr_size > undo->size); diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc index a9077cb19a3..b50452c1d5d 100644 --- a/storage/xtradb/lock/lock0lock.cc +++ b/storage/xtradb/lock/lock0lock.cc @@ -8042,7 +8042,10 @@ lock_trx_release_locks( } mutex_exit(&trx_sys->mutex); } else { - ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE)); + ut_ad(trx_state_eq(trx, TRX_STATE_ACTIVE) + || (trx_state_eq(trx, TRX_STATE_COMMITTED_IN_MEMORY) + && trx->is_recovered + && !UT_LIST_GET_LEN(trx->lock.trx_locks))); } /* The transition of trx->state to TRX_STATE_COMMITTED_IN_MEMORY diff --git a/storage/xtradb/trx/trx0trx.cc b/storage/xtradb/trx/trx0trx.cc index 2b0b05dc327..b3d709ccf8a 100644 --- a/storage/xtradb/trx/trx0trx.cc +++ b/storage/xtradb/trx/trx0trx.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2017, MariaDB Corporation. +Copyright (c) 2015, 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 @@ -1472,6 +1472,8 @@ trx_commit_in_memory( if (lsn) { ulint flush_log_at_trx_commit; + DEBUG_SYNC_C("after_trx_committed_in_memory"); + if (trx->insert_undo != NULL) { trx_undo_insert_cleanup(trx); diff --git a/storage/xtradb/trx/trx0undo.cc b/storage/xtradb/trx/trx0undo.cc index 0d5a0f55f0d..594416ba34d 100644 --- a/storage/xtradb/trx/trx0undo.cc +++ b/storage/xtradb/trx/trx0undo.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2014, 2017, 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 @@ -1989,7 +1989,9 @@ trx_undo_insert_cleanup( mutex_exit(&(rseg->mutex)); - trx_undo_seg_free(undo); + if (!srv_read_only_mode) { + trx_undo_seg_free(undo); + } mutex_enter(&(rseg->mutex)); |