summaryrefslogtreecommitdiff
path: root/innobase/srv/srv0start.c
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-08-08 15:24:47 +0300
committerunknown <monty@hundin.mysql.fi>2002-08-08 15:24:47 +0300
commit267b80834ad524c0d72976bc71e5b5bc9815ea1a (patch)
treee7f4a2013ed3d66e640f6574e62cb7e534a5d77f /innobase/srv/srv0start.c
parentca1875f54033c5ea067ec3ec07b00375de6975d7 (diff)
parent40d3c3901b0427eba76119730f46784f946990b3 (diff)
downloadmariadb-git-267b80834ad524c0d72976bc71e5b5bc9815ea1a.tar.gz
merge with 3.23.52
BitKeeper/etc/logging_ok: auto-union configure.in: Auto merged Docs/manual.texi: Auto merged include/my_pthread.h: Auto merged include/mysql_com.h: Auto merged include/mysql_version.h.in: Auto merged innobase/btr/btr0cur.c: Auto merged innobase/btr/btr0sea.c: Auto merged innobase/buf/buf0buf.c: Auto merged innobase/buf/buf0lru.c: Auto merged innobase/configure.in: Auto merged innobase/dict/dict0dict.c: Auto merged innobase/fil/fil0fil.c: Auto merged innobase/fsp/fsp0fsp.c: Auto merged innobase/include/buf0buf.ic: Auto merged innobase/include/dyn0dyn.ic: Auto merged innobase/include/ha0ha.ic: Auto merged innobase/include/sync0rw.ic: Auto merged innobase/include/univ.i: Auto merged innobase/lock/lock0lock.c: Auto merged innobase/log/log0log.c: Auto merged innobase/mem/mem0dbg.c: Auto merged innobase/os/os0file.c: Auto merged innobase/os/os0thread.c: Auto merged innobase/page/page0cur.c: Auto merged innobase/srv/srv0srv.c: Auto merged innobase/sync/sync0arr.c: Auto merged innobase/sync/sync0rw.c: Auto merged innobase/sync/sync0sync.c: Auto merged innobase/trx/trx0trx.c: Auto merged myisam/mi_create.c: Auto merged sql/ha_innodb.h: Auto merged sql/lex.h: Auto merged sql/log.cc: Auto merged sql/mysqld.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_insert.cc: Auto merged strings/Makefile.am: Auto merged support-files/mysql.server.sh: Auto merged include/my_base.h: merge with 3.23.52 (use local file) include/sslopt-usage.h: merge with 3.23.52 (use local file) myisam/mi_search.c: merge with 3.23.52 (use local file) myisam/mi_write.c: merge with 3.23.52 (use local file) mysql-test/r/group_by.result: merge with 3.23.52 (Need to be fixed before push) mysys/my_pthread.c: merge with 3.23.52 (use local file) sql/gen_lex_hash.cc: merge with 3.23.52 (use local file) sql/ha_innodb.cc: Total hand-merge with 3.23.52 sql/sql_yacc.yy: merge with 3.23.52 (use local file) support-files/mysql.spec.sh: merge with 3.23.52 (use local file)
Diffstat (limited to 'innobase/srv/srv0start.c')
-rw-r--r--innobase/srv/srv0start.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index 55e734be3bd..dfa122b2ece 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -74,6 +74,12 @@ ulint ios;
ulint n[SRV_MAX_N_IO_THREADS + 5];
os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 5];
+/* We use this mutex to test the return value of pthread_mutex_trylock
+ on successful locking. HP-UX does NOT return 0, though Linux et al do. */
+os_fast_mutex_t srv_os_test_mutex;
+
+ibool srv_os_test_mutex_is_locked = FALSE;
+
#define SRV_N_PENDING_IOS_PER_THREAD OS_AIO_N_PENDING_IOS_PER_THREAD
#define SRV_MAX_N_PENDING_SYNC_IOS 100
@@ -927,6 +933,8 @@ innobase_start_or_create_for_mysql(void)
ulint max_arch_log_no;
ibool start_archive;
ulint sum_of_new_sizes;
+ ulint sum_of_data_file_sizes;
+ ulint tablespace_size_in_header;
ulint err;
ulint i;
ulint k;
@@ -1324,7 +1332,49 @@ innobase_start_or_create_for_mysql(void)
os_thread_create(&srv_master_thread, NULL, thread_ids + 1 +
SRV_MAX_N_IO_THREADS);
/* buf_debug_prints = TRUE; */
+
+ sum_of_data_file_sizes = 0;
+ for (i = 0; i < srv_n_data_files; i++) {
+ sum_of_data_file_sizes += srv_data_file_sizes[i];
+ }
+
+ tablespace_size_in_header = fsp_header_get_tablespace_size(0);
+
+ if (!srv_auto_extend_last_data_file
+ && sum_of_data_file_sizes != tablespace_size_in_header) {
+
+ fprintf(stderr,
+"InnoDB: Error: tablespace size stored in header is %lu pages, but\n"
+"InnoDB: the sum of data file sizes is %lu pages\n",
+ tablespace_size_in_header, sum_of_data_file_sizes);
+ }
+
+ if (srv_auto_extend_last_data_file
+ && sum_of_data_file_sizes < tablespace_size_in_header) {
+
+ fprintf(stderr,
+"InnoDB: Error: tablespace size stored in header is %lu pages, but\n"
+"InnoDB: the sum of data file sizes is only %lu pages\n",
+ tablespace_size_in_header, sum_of_data_file_sizes);
+ }
+
+ /* Check that os_fast_mutexes work as exptected */
+ os_fast_mutex_init(&srv_os_test_mutex);
+
+ if (0 != os_fast_mutex_trylock(&srv_os_test_mutex)) {
+ fprintf(stderr,
+"InnoDB: Error: pthread_mutex_trylock returns an unexpected value on\n"
+ "InnoDB: success! Cannot continue.\n");
+ exit(1);
+ }
+
+ os_fast_mutex_unlock(&srv_os_test_mutex);
+
+ os_fast_mutex_lock(&srv_os_test_mutex);
+
+ os_fast_mutex_unlock(&srv_os_test_mutex);
+
if (srv_print_verbose_log)
{
ut_print_timestamp(stderr);