From 5eaa3c4e341dca7b87b9a36fca0c108ce6c18f5c Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Mon, 2 Jun 2003 16:11:06 +0300 Subject: [PATCH 1/3] com0shm.c: Removed auto event creation because it is not needed in any MySQL/InnoDB code --- innobase/com/com0shm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/innobase/com/com0shm.c b/innobase/com/com0shm.c index 72ab23b9be8..ed185ccdf47 100644 --- a/innobase/com/com0shm.c +++ b/innobase/com/com0shm.c @@ -103,7 +103,8 @@ struct com_shm_endpoint_struct{ the area currently may contain a datagram; NOTE: automatic event */ os_event_t empty; /* this is in the signaled state if the area - currently may be empty; NOTE: automatic event */ + currently may be empty; NOTE: automatic + event */ ip_mutex_hdl_t* ip_mutex; /* handle to the interprocess mutex protecting the shared memory */ UT_LIST_NODE_T(com_shm_endpoint_t) list; /* If the endpoint struct @@ -793,16 +794,18 @@ com_shm_create_or_open( ut_strcpy(buf + len, (char*)"_IBSHM_EV_NE"), - event_ne = os_event_create_auto(buf); + event_ne = os_event_create(buf); ut_ad(event_ne); ut_strcpy(buf + len, (char*)"_IBSHM_EV_EM"), - event_em = os_event_create_auto(buf); + event_em = os_event_create(buf); ut_ad(event_em); + ut_a(0); /* event_ne and event_em should be auto events! */ + com_shm_endpoint_set_shm(ep, shm); com_shm_endpoint_set_map(ep, map); From ce8e0aa0c41f9c68cc6d5101ba58236d7cb63f31 Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Mon, 2 Jun 2003 17:58:18 +0300 Subject: [PATCH 2/3] os0sync.c: Do not try to reserve os_sync_mutex in shutdown after it has been freed --- innobase/os/os0sync.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/innobase/os/os0sync.c b/innobase/os/os0sync.c index 0fe61fe570d..bf5fc57bf57 100644 --- a/innobase/os/os0sync.c +++ b/innobase/os/os0sync.c @@ -88,6 +88,12 @@ os_sync_free(void) mutex = UT_LIST_GET_FIRST(os_mutex_list); while (mutex) { + if (mutex == os_sync_mutex) { + /* Set the flag to FALSE so that we do not try to + reserve os_sync_mutex any more in remaining freeing + operations in shutdown */ + os_sync_mutex_inited = FALSE; + } os_mutex_free(mutex); @@ -517,13 +523,17 @@ os_mutex_free( { ut_a(mutex); - os_mutex_enter(os_sync_mutex); + if (os_sync_mutex_inited) { + os_mutex_enter(os_sync_mutex); + } UT_LIST_REMOVE(os_mutex_list, os_mutex_list, mutex); os_mutex_count--; - os_mutex_exit(os_sync_mutex); + if (os_sync_mutex_inited) { + os_mutex_exit(os_sync_mutex); + } #ifdef __WIN__ ut_a(CloseHandle(mutex->handle)); @@ -614,9 +624,16 @@ os_fast_mutex_free( #else ut_a(0 == pthread_mutex_destroy(fast_mutex)); #endif - os_mutex_enter(os_sync_mutex); + if (os_sync_mutex_inited) { + /* When freeing the last mutexes, we have + already freed os_sync_mutex */ + + os_mutex_enter(os_sync_mutex); + } os_fast_mutex_count--; - os_mutex_exit(os_sync_mutex); + if (os_sync_mutex_inited) { + os_mutex_exit(os_sync_mutex); + } } From 4d5ae1d37c22cd6dea442571f5936e86b6cbc109 Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Mon, 2 Jun 2003 17:30:47 +0200 Subject: [PATCH 3/3] Clearer error message (in the customer's case, the relay log was corrupted, not the master's binlog) (SW 1571). --- sql/slave.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sql/slave.cc b/sql/slave.cc index b655b17c258..ec1041894bd 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2081,8 +2081,13 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli) else { sql_print_error("\ -Could not parse log event entry, check the master for binlog corruption\n\ -This may also be a network problem, or just a bug in the master or slave code.\ +Could not parse relay log event entry. The possible reasons are: the master's \ +binary log is corrupted (you can check this by running 'mysqlbinlog' on the \ +binary log), the slave's relay log is corrupted (you can check this by running \ +'mysqlbinlog' on the relay log), a network problem, or a bug in the master's \ +or slave's MySQL code. If you want to check the master's binary log or slave's \ +relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' \ +on this slave.\ "); return 1; }