Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
e0d74efd
Commit
e0d74efd
authored
Apr 06, 2009
by
Alfranio Correia
Browse files
Options
Browse Files
Download
Plain Diff
merge 5.1-bugteam --> 5.1-bugteam (local)
parents
a81e21f8
f3314e90
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
129 additions
and
14 deletions
+129
-14
mysql-test/suite/rpl/r/rpl_bug33931.result
mysql-test/suite/rpl/r/rpl_bug33931.result
+5
-5
mysql-test/suite/rpl/r/rpl_init_slave_errors.result
mysql-test/suite/rpl/r/rpl_init_slave_errors.result
+18
-0
mysql-test/suite/rpl/t/rpl_bug33931.test
mysql-test/suite/rpl/t/rpl_bug33931.test
+3
-3
mysql-test/suite/rpl/t/rpl_init_slave_errors.test
mysql-test/suite/rpl/t/rpl_init_slave_errors.test
+86
-0
sql/slave.cc
sql/slave.cc
+17
-6
No files found.
mysql-test/suite/rpl/r/rpl_bug33931.result
View file @
e0d74efd
reset master;
reset master;
call mtr.add_suppression("Failed during slave
.*
thread initialization");
call mtr.add_suppression("Failed during slave
thread initialization");
stop slave;
stop slave;
reset slave;
reset slave;
SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
...
@@ -23,8 +23,8 @@ Replicate_Do_Table
...
@@ -23,8 +23,8 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Replicate_Wild_Ignore_Table
Last_Errno
0
Last_Errno
#
Last_Error
Last_Error
Failed during slave thread initialization
Skip_Counter 0
Skip_Counter 0
Exec_Master_Log_Pos 0
Exec_Master_Log_Pos 0
Relay_Log_Space #
Relay_Log_Space #
...
@@ -41,6 +41,6 @@ Seconds_Behind_Master #
...
@@ -41,6 +41,6 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Errno 0
Last_IO_Error
Last_IO_Error
Last_SQL_Errno
0
Last_SQL_Errno
#
Last_SQL_Error
Last_SQL_Error
Failed during slave thread initialization
SET GLOBAL debug="";
SET GLOBAL debug="";
mysql-test/suite/rpl/r/rpl_init_slave_errors.result
0 → 100644
View file @
e0d74efd
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
stop slave;
reset slave;
SET GLOBAL debug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
start slave;
Reporting the following error: Failed during slave thread initialization
SET GLOBAL debug= "";
stop slave;
reset slave;
SET GLOBAL init_slave= "garbage";
start slave;
Reporting the following error: Slave SQL thread aborted. Can't execute init_slave query
SET GLOBAL init_slave= "";
mysql-test/suite/rpl/t/rpl_bug33931.test
View file @
e0d74efd
...
@@ -15,7 +15,7 @@ reset master;
...
@@ -15,7 +15,7 @@ reset master;
connection
slave
;
connection
slave
;
# Add suppression for expected warnings in slaves error log
# Add suppression for expected warnings in slaves error log
call
mtr
.
add_suppression
(
"Failed during slave
.*
thread initialization"
);
call
mtr
.
add_suppression
(
"Failed during slave
thread initialization"
);
--
disable_warnings
--
disable_warnings
stop
slave
;
stop
slave
;
...
@@ -38,7 +38,7 @@ connection slave;
...
@@ -38,7 +38,7 @@ connection slave;
source
include
/
wait_for_slave_to_stop
.
inc
;
source
include
/
wait_for_slave_to_stop
.
inc
;
--
replace_result
$MASTER_MYPORT
MASTER_PORT
--
replace_result
$MASTER_MYPORT
MASTER_PORT
--
replace_column
1
# 8 # 9 #
23 # 33 #
--
replace_column
1
# 8 # 9 #
19 # 23 # 33 # 37 #
query_vertical
show
slave
status
;
query_vertical
show
slave
status
;
#
#
...
...
mysql-test/suite/rpl/t/rpl_init_slave_errors.test
0 → 100644
View file @
e0d74efd
######################################################################
# Some errors that cause the slave SQL thread to stop are not shown in
# the Slave_SQL_Error column of "SHOW SLAVE STATUS". Instead, the error
# is only in the server's error log.
#
# Two failures and their respective reporting are verified:
#
# 1 - Failures during slave thread initialization
# 2 - Failures while processing queries passed through the init_slave
# option.
#
# In order to check the first type of failure, we inject a fault in the
# SQL/IO Threads through SET GLOBAL debug.
#
# To check the second type, we set @@global.init_slave to an invalid
# command thus preventing the initialization of the SQL Thread.
#
# Obs:
# 1 - Note that testing failures while initializing the relay log position
# is hard as the same function is called before the code reaches the point
# that we want to test.
#
# 2 - This test does not target failures that are reported while applying
# events such as duplicate keys, errors while reading the relay-log.bin*,
# etc. Such errors are already checked on other tests.
######################################################################
######################################################################
# Configuring the Environment
######################################################################
source
include
/
have_debug
.
inc
;
source
include
/
master
-
slave
.
inc
;
source
include
/
have_log_bin
.
inc
;
connection
slave
;
--
disable_warnings
stop
slave
;
--
enable_warnings
reset
slave
;
######################################################################
# Injecting faults in the threads' initialization
######################################################################
connection
slave
;
# Set debug flags on slave to force errors to occur
SET
GLOBAL
debug
=
"d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init"
;
start
slave
;
#
# slave is going to stop because of emulated failures
# but there won't be any crashes nor asserts hit.
#
source
include
/
wait_for_slave_to_stop
.
inc
;
let
$error
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_Error
,
1
);
echo
Reporting
the
following
error
:
$error
;
SET
GLOBAL
debug
=
""
;
######################################################################
# Injecting faults in the init_slave option
######################################################################
connection
slave
;
--
disable_warnings
stop
slave
;
--
enable_warnings
source
include
/
wait_for_slave_to_stop
.
inc
;
reset
slave
;
SET
GLOBAL
init_slave
=
"garbage"
;
start
slave
;
source
include
/
wait_for_slave_sql_to_stop
.
inc
;
let
$error
=
query_get_value
(
SHOW
SLAVE
STATUS
,
Last_Error
,
1
);
echo
Reporting
the
following
error
:
$error
;
######################################################################
# Clean up
######################################################################
SET
GLOBAL
init_slave
=
""
;
sql/slave.cc
View file @
e0d74efd
...
@@ -2713,7 +2713,8 @@ pthread_handler_t handle_slave_sql(void *arg)
...
@@ -2713,7 +2713,8 @@ pthread_handler_t handle_slave_sql(void *arg)
*/
*/
pthread_cond_broadcast
(
&
rli
->
start_cond
);
pthread_cond_broadcast
(
&
rli
->
start_cond
);
pthread_mutex_unlock
(
&
rli
->
run_lock
);
pthread_mutex_unlock
(
&
rli
->
run_lock
);
sql_print_error
(
"Failed during slave thread initialization"
);
rli
->
report
(
ERROR_LEVEL
,
ER_SLAVE_FATAL_ERROR
,
"Failed during slave thread initialization"
);
goto
err
;
goto
err
;
}
}
thd
->
init_for_queries
();
thd
->
init_for_queries
();
...
@@ -2758,8 +2759,8 @@ pthread_handler_t handle_slave_sql(void *arg)
...
@@ -2758,8 +2759,8 @@ pthread_handler_t handle_slave_sql(void *arg)
1
/*need data lock*/
,
&
errmsg
,
1
/*need data lock*/
,
&
errmsg
,
1
/*look for a description_event*/
))
1
/*look for a description_event*/
))
{
{
sql_print_error
(
"Error initializing relay log position: %s"
,
rli
->
report
(
ERROR_LEVEL
,
ER_SLAVE_FATAL_ERROR
,
errmsg
);
"Error initializing relay log position: %s"
,
errmsg
);
goto
err
;
goto
err
;
}
}
THD_CHECK_SENTRY
(
thd
);
THD_CHECK_SENTRY
(
thd
);
...
@@ -2812,8 +2813,8 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
...
@@ -2812,8 +2813,8 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
execute_init_command
(
thd
,
&
sys_init_slave
,
&
LOCK_sys_init_slave
);
execute_init_command
(
thd
,
&
sys_init_slave
,
&
LOCK_sys_init_slave
);
if
(
thd
->
is_slave_error
)
if
(
thd
->
is_slave_error
)
{
{
sql_print_error
(
"\
rli
->
report
(
ERROR_LEVEL
,
thd
->
main_da
.
sql_errno
(),
Slave SQL thread aborted. Can't execute init_slave query"
);
"
Slave SQL thread aborted. Can't execute init_slave query"
);
goto
err
;
goto
err
;
}
}
}
}
...
@@ -2863,10 +2864,20 @@ Slave SQL thread aborted. Can't execute init_slave query");
...
@@ -2863,10 +2864,20 @@ Slave SQL thread aborted. Can't execute init_slave query");
thd
->
main_da
.
sql_errno
(),
last_errno
));
thd
->
main_da
.
sql_errno
(),
last_errno
));
if
(
last_errno
==
0
)
if
(
last_errno
==
0
)
{
{
/*
This function is reporting an error which was not reported
while executing exec_relay_log_event().
*/
rli
->
report
(
ERROR_LEVEL
,
thd
->
main_da
.
sql_errno
(),
errmsg
);
rli
->
report
(
ERROR_LEVEL
,
thd
->
main_da
.
sql_errno
(),
errmsg
);
}
}
else
if
(
last_errno
!=
thd
->
main_da
.
sql_errno
())
else
if
(
last_errno
!=
thd
->
main_da
.
sql_errno
())
{
{
/*
* An error was reported while executing exec_relay_log_event()
* however the error code differs from what is in the thread.
* This function prints out more information to help finding
* what caused the problem.
*/
sql_print_error
(
"Slave (additional info): %s Error_code: %d"
,
sql_print_error
(
"Slave (additional info): %s Error_code: %d"
,
errmsg
,
thd
->
main_da
.
sql_errno
());
errmsg
,
thd
->
main_da
.
sql_errno
());
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment