summaryrefslogtreecommitdiff
path: root/innobase/srv/srv0start.c
diff options
context:
space:
mode:
Diffstat (limited to 'innobase/srv/srv0start.c')
-rw-r--r--innobase/srv/srv0start.c43
1 files changed, 32 insertions, 11 deletions
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index 69341a1d7d1..c91db1f0dcc 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -1378,14 +1378,39 @@ NetWare. */
return(DB_ERROR);
}
- /* Since ibuf init is in dict_boot, and ibuf is needed
- in any disk i/o, first call dict_boot */
+ /* Since the insert buffer init is in dict_boot, and the
+ insert buffer is needed in any disk i/o, first we call
+ dict_boot(). Note that trx_sys_init_at_db_start() only needs
+ to access space 0, and the insert buffer at this stage already
+ works for space 0. */
dict_boot();
trx_sys_init_at_db_start();
- /* The following needs trx lists which are initialized in
- trx_sys_init_at_db_start */
+ if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {
+ /* The following call is necessary for the insert
+ buffer to work with multiple tablespaces. We must
+ know the mapping between space id's and .ibd file
+ names.
+
+ In a crash recovery, we check that the info in data
+ dictionary is consistent with what we already know
+ about space id's from the call of
+ fil_load_single_table_tablespaces().
+
+ In a normal startup, we create the space objects for
+ every table in the InnoDB data dictionary that has
+ an .ibd file.
+
+ We also determine the maximum tablespace id used.
+
+ TODO: We may have incomplete transactions in the
+ data dictionary tables. Does that harm the scanning of
+ the data dictionary below? */
+
+ dict_check_tablespaces_and_store_max_id(
+ recv_needed_recovery);
+ }
srv_startup_is_before_trx_rollback_phase = FALSE;
@@ -1393,6 +1418,9 @@ NetWare. */
system */
fsp_header_get_free_limit(0);
+ /* recv_recovery_from_checkpoint_finish needs trx lists which
+ are initialized in trx_sys_init_at_db_start(). */
+
recv_recovery_from_checkpoint_finish();
}
@@ -1433,13 +1461,6 @@ NetWare. */
}
}
#endif /* UNIV_LOG_ARCHIVE */
- if (!create_new_db && srv_force_recovery == 0) {
- /* After a crash recovery we only check that the info in data
- dictionary is consistent with what we already know about space
- id's from the call of fil_load_single_table_tablespaces(). */
-
- dict_check_tablespaces_or_store_max_id(recv_needed_recovery);
- }
if (srv_measure_contention) {
/* os_thread_create(&test_measure_cont, NULL, thread_ids +