summaryrefslogtreecommitdiff
path: root/innobase/srv
diff options
context:
space:
mode:
authorunknown <serg@sergbook.mysql.com>2004-12-31 15:26:24 +0100
committerunknown <serg@sergbook.mysql.com>2004-12-31 15:26:24 +0100
commitb99bea6704299399c84bd8374ef7f248ff9570c5 (patch)
tree928b06c231edee4cb95ace87ed30e879e3dcb0fb /innobase/srv
parentbd23099be0b22845e8c97e2fb36ee3c6eb0e2491 (diff)
parent5eaf65ab4be77911eb03cceefac9ecea48c25f71 (diff)
downloadmariadb-git-b99bea6704299399c84bd8374ef7f248ff9570c5.tar.gz
manually merged
configure.in: Auto merged client/mysqldump.c: Auto merged innobase/buf/buf0rea.c: Auto merged innobase/dict/dict0load.c: Auto merged innobase/fil/fil0fil.c: Auto merged innobase/include/fil0fil.h: Auto merged innobase/include/row0mysql.h: Auto merged innobase/include/trx0trx.h: Auto merged innobase/os/os0file.c: Auto merged innobase/row/row0ins.c: Auto merged innobase/row/row0mysql.c: Auto merged innobase/row/row0sel.c: Auto merged innobase/srv/srv0start.c: Auto merged innobase/trx/trx0trx.c: Auto merged libmysqld/lib_sql.cc: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/alter_table.result: Auto merged mysql-test/r/ctype_ucs.result: Auto merged mysql-test/r/func_str.result: Auto merged mysql-test/r/grant.result: Auto merged mysql-test/r/grant_cache.result: Auto merged mysql-test/r/merge.result: Auto merged mysql-test/r/ndb_blob.result: Auto merged mysql-test/r/ps_1general.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/timezone2.result: Auto merged mysql-test/t/ctype_ucs.test: Auto merged mysql-test/t/grant.test: Auto merged mysql-test/t/merge.test: Auto merged mysql-test/t/multi_update.test: Auto merged mysql-test/t/mysqldump.test: Auto merged mysql-test/t/subselect.test: Auto merged ndb/src/ndbapi/NdbBlob.cpp: Auto merged ndb/src/ndbapi/NdbConnection.cpp: Auto merged ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged ndb/src/ndbapi/NdbOperationDefine.cpp: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_myisammrg.cc: Auto merged sql/ha_myisammrg.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql-common/client.c: Auto merged sql/sql_table.cc: Auto merged sql/strfunc.cc: Auto merged sql/unireg.cc: Auto merged vio/vio.c: Auto merged vio/viosocket.c: Auto merged
Diffstat (limited to 'innobase/srv')
-rw-r--r--innobase/srv/srv0start.c70
1 files changed, 59 insertions, 11 deletions
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index a0e763d7a44..061bdb82d3e 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();
}
@@ -1431,13 +1459,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 +
@@ -1505,6 +1526,21 @@ NetWare. */
"InnoDB: the sum of data file sizes is %lu pages\n",
(ulong) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes);
+
+ if (srv_force_recovery == 0
+ && sum_of_data_file_sizes < tablespace_size_in_header) {
+ /* This is a fatal error, the tail of a tablespace is
+ missing */
+
+ fprintf(stderr,
+"InnoDB: Cannot start InnoDB. The tail of the system tablespace is\n"
+"InnoDB: missing. Have you edited innodb_data_file_path in my.cnf in an\n"
+"InnoDB: inappropriate way, removing ibdata files from there?\n"
+"InnoDB: You can set innodb_force_recovery=1 in my.cnf to force\n"
+"InnoDB: a startup if you are trying to recover a badly corrupt database.\n");
+
+ return(DB_ERROR);
+ }
}
if (srv_auto_extend_last_data_file
@@ -1515,6 +1551,18 @@ NetWare. */
"InnoDB: the sum of data file sizes is only %lu pages\n",
(ulong) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes);
+
+ if (srv_force_recovery == 0) {
+
+ fprintf(stderr,
+"InnoDB: Cannot start InnoDB. The tail of the system tablespace is\n"
+"InnoDB: missing. Have you edited innodb_data_file_path in my.cnf in an\n"
+"InnoDB: inappropriate way, removing ibdata files from there?\n"
+"InnoDB: You can set innodb_force_recovery=1 in my.cnf to force\n"
+"InnoDB: a startup if you are trying to recover a badly corrupt database.\n");
+
+ return(DB_ERROR);
+ }
}
/* Check that os_fast_mutexes work as expected */