From fc0a25ec49f32fd292cb87c8a855e1569ccf8878 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Nov 2007 17:09:51 +0100 Subject: WL#3071 Maria checkpoint, WL#3072 Maria recovery instead of fprintf(stderr) when a task (with no user connected) gets an error, use my_printf_error(). Flags ME_JUST_WARNING and ME_JUST_INFO added to my_error()/my_printf_error(), which pass it to my_message_sql() which is modified to call the appropriate sql_print_*(). This way recovery can signal its start and end with [Note] and not [ERROR] (but failure with [ERROR]). Recovery's detailed progress (percents etc) still uses stderr as they have to stay on one single line. sql_print_error() changed to use my_progname_short (nicer display). mysql-test-run.pl --gdb/--ddd does not run mysqld, because a breakpoint in mysql_parse is too late to debug startup problems; instead, dev should set the breakpoints it wants and then "run" ("r"). include/my_sys.h: new flags to tell error_handler_hook that this is not an error but an information or warning mysql-test/mysql-test-run.pl: when running with --gdb/--ddd to debug mysqld, breaking at mysql_parse is too late to debug startup problems; now, it does not run mysqld, does not set breakpoints, developer can set as early breakpoints as it wants and is responsible for typing "run" (or "r") mysys/my_init.c: set my_progname_short mysys/my_static.c: my_progname_short added sql/mysqld.cc: * my_message_sql() can now receive info or warning, not only error; this allows mysys to tell the user (or the error log if no user) about an info or warning. Used from Maria. * plugins (or engines like Maria) may want to call my_error(), so set up the error handler hook (my_message_sql) before initializing plugins; otherwise they get my_message_no_curses which is less integrated into mysqld (is just fputs()) * using my_progname_short instead of my_progname, in my_message_sql() (less space on screen) storage/maria/ma_checkpoint.c: fprintf(stderr) -> ma_message_no_user() storage/maria/ma_checkpoint.h: function for any Maria task, not connected to a user (example: checkpoint, recovery; soon could be deleted records purger) to report a message (calls my_printf_error() which, when inside ha_maria, leads to sql_print_*(), and when outside, leads to my_message_no_curses i.e. stderr). storage/maria/ma_recovery.c: To tell that recovery starts and ends we use ma_message_no_user() (sql_print_*() in practice). Detailed progress info still uses stderr as sql_print() cannot put several messages on one line. 071116 18:42:16 [Note] mysqld: Maria engine: starting recovery recovered pages: 0% 67% 100% (0.0 seconds); transactions to roll back: 1 0 (0.0 seconds); tables to flush: 1 0 (0.0 seconds); 071116 18:42:16 [Note] mysqld: Maria engine: recovery done storage/maria/maria_chk.c: my_progname_short moved to mysys storage/maria/maria_read_log.c: my_progname_short moved to mysys storage/myisam/myisamchk.c: my_progname_short moved to mysys --- mysys/my_static.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysys/my_static.c') diff --git a/mysys/my_static.c b/mysys/my_static.c index cb482b19b57..ef25a89bad9 100644 --- a/mysys/my_static.c +++ b/mysys/my_static.c @@ -26,7 +26,7 @@ my_bool timed_mutexes= 0; /* from my_init */ char * home_dir=0; -const char *my_progname=0; +const char *my_progname= NULL, *my_progname_short= NULL; char NEAR curr_dir[FN_REFLEN]= {0}, NEAR home_dir_buff[FN_REFLEN]= {0}; ulong my_stream_opened=0,my_file_opened=0, my_tmp_file_created=0; -- cgit v1.2.1 From ca23272e1e53e195169bec0609eb0168722e1879 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 27 Aug 2008 14:15:06 +0200 Subject: proc_info_hook, mysys access to thd->proc_info include/my_global.h: move __func__ definition to my_global.h include/my_sys.h: proc_info_hook mysys/my_static.c: proc_info_hook sql/mysqld.cc: proc_info_hook sql/sql_class.cc: support thd==0 in set_thd_proc_info sql/sql_profile.cc: move __func__ definition to my_global.h sql/sql_profile.h: move __func__ definition to my_global.h --- mysys/my_static.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mysys/my_static.c') diff --git a/mysys/my_static.c b/mysys/my_static.c index ef25a89bad9..4dc965e8a20 100644 --- a/mysys/my_static.c +++ b/mysys/my_static.c @@ -92,6 +92,15 @@ int (*error_handler_hook)(uint error,const char *str,myf MyFlags)= int (*fatal_error_handler_hook)(uint error,const char *str,myf MyFlags)= my_message_no_curses; +static const char *proc_info_dummy(void *a, const char *b, const char *c, + const char *d, const unsigned int e) +{ + return 0; +} + +const char *(*proc_info_hook)(void *, const char *, const char *, const char *, + const unsigned int)= proc_info_dummy; + #ifdef __WIN__ /* from my_getsystime.c */ ulonglong query_performance_frequency, query_performance_offset; -- cgit v1.2.1 From 2b917502c1cd78699ee99b4cd6d388fcff29d76a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 29 Aug 2008 21:50:04 +0200 Subject: added __attribute__((unused)) --- mysys/my_static.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mysys/my_static.c') diff --git a/mysys/my_static.c b/mysys/my_static.c index 4dc965e8a20..a82c9bf518c 100644 --- a/mysys/my_static.c +++ b/mysys/my_static.c @@ -92,8 +92,11 @@ int (*error_handler_hook)(uint error,const char *str,myf MyFlags)= int (*fatal_error_handler_hook)(uint error,const char *str,myf MyFlags)= my_message_no_curses; -static const char *proc_info_dummy(void *a, const char *b, const char *c, - const char *d, const unsigned int e) +static const char *proc_info_dummy(void *a __attribute__((unused)), + const char *b __attribute__((unused)), + const char *c __attribute__((unused)), + const char *d __attribute__((unused)), + const unsigned int e __attribute__((unused))) { return 0; } -- cgit v1.2.1 From 9c96fde1206f254d0dd25dbe2cc1706c44e4bdea Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 15 Jan 2009 22:27:36 +0100 Subject: post-review fixes include/atomic/generic-msvc.h: prevent possible compiler warnings include/lf.h: comments, better definition for LF_HASH_OVERHEAD include/maria.h: define MARIA_CANNOT_ROLLBACK here include/my_pthread.h: avoid possible name clash include/waiting_threads.h: comments, const, move WT_RESOURCE to waiting_threads.c mysql-test/suite/maria/r/maria_notembedded.result: new test mysql-test/suite/maria/t/maria_notembedded.test: new test - 5-way deadlock mysys/lf_hash.c: better definition for LF_HASH_OVERHEAD mysys/my_static.c: comment mysys/my_thr_init.c: casts mysys/waiting_threads.c: comments, asserts, etc server-tools/instance-manager/parse.cc: fix my_init_dynamic_array() to follow new calling conventions sql/mysqld.cc: call wt_init after set_proper_floating_point_mode sql/sql_class.h: comment storage/maria/ha_maria.cc: move MARIA_CANNOT_ROLLBACK to a common header storage/maria/ma_commit.c: comment storage/maria/ma_write.c: comments, check for HA_ERR_FOUND_DUPP_KEY storage/maria/trnman.c: comments, assert storage/maria/trnman.h: comments storage/maria/unittest/trnman-t.c: be paranoid unittest/mysys/lf-t.c: comments unittest/mysys/waiting_threads-t.c: comments, safety, memory leak --- mysys/my_static.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mysys/my_static.c') diff --git a/mysys/my_static.c b/mysys/my_static.c index 04bda8d2dcc..c33d05420c9 100644 --- a/mysys/my_static.c +++ b/mysys/my_static.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. 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 @@ -101,6 +101,7 @@ static const char *proc_info_dummy(void *a __attribute__((unused)), return 0; } +/* this is to be able to call set_thd_proc_info from the C code */ const char *(*proc_info_hook)(void *, const char *, const char *, const char *, const unsigned int)= proc_info_dummy; -- cgit v1.2.1 From 12648015b322e885923f87d919c07529423a0eca Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Mon, 9 Aug 2010 20:05:42 +0300 Subject: Added --sync-sys=0 option for mysqld to skip sync() calls for faster testing Fixed LP#613418 (M)aria recovery failure: ma_key_recover.c:981: _ma_apply_redo_index: Assertion `check_page_length == page_length' failed include/my_sys.h: Added my_disable_sync mysql-test/mysql-test-run.pl: Added --sync-sys=0 to run test suite faster mysys/my_static.c: Added my_disable_sync mysys/my_sync.c: Added my_disable_sync sql/mysqld.cc: Added -sync-sys=0 option for mysqld to skip sync() calls for faster testing storage/maria/ma_key_recover.c: More DBUG_ASSERT() Added logging of KEY_OP_DEBUG to make examening of logs easier Fixed testing of page length in recovery to ensure we don't overwrite checksum (previous tests was too relaxed) Fixed bug in recovery logging of split pages which caused failure during recovery: - Length was not adjusted properly for pages to be split - Added KEY_OP_MAX_PAGELENGTH to tell recovery that page is now full length - This fixed LP#613418 storage/maria/ma_key_recover.h: Changed prototype for ma_log_change() for KEY_OP_DEBUG storage/maria/ma_loghandler.h: Added new enums for better debugging of recovery logs storage/maria/ma_rt_index.c: Added debugging information to calls to ma_log_change() storage/maria/ma_write.c: Added debugging information to calls to ma_log_change() and ma_log_split() --- mysys/my_static.c | 1 + 1 file changed, 1 insertion(+) (limited to 'mysys/my_static.c') diff --git a/mysys/my_static.c b/mysys/my_static.c index 0ef5656b76f..08653d03d21 100644 --- a/mysys/my_static.c +++ b/mysys/my_static.c @@ -119,6 +119,7 @@ ulonglong query_performance_frequency, query_performance_offset; /* How to disable options */ my_bool NEAR my_disable_locking=0; +my_bool NEAR my_disable_sync=0; my_bool NEAR my_disable_async_io=0; my_bool NEAR my_disable_flush_key_blocks=0; my_bool NEAR my_disable_symlinks=0; -- cgit v1.2.1