Commit 8d5a0d65 authored by Monty's avatar Monty

Cleanups and minor fixes

- Fixed typos
- Added --core-on-failure to mysql-test-run
- More DBUG_PRINT in viosocket.c
- Don't forget CLIENT_REMEMBER_OPTIONS for compressed slave protocol
- Removed not used stage variables
parent 05f61ba4
...@@ -338,7 +338,7 @@ sub dump_core { ...@@ -338,7 +338,7 @@ sub dump_core {
my ($self)= @_; my ($self)= @_;
return if IS_WINDOWS; return if IS_WINDOWS;
my $pid= $self->{SAFE_PID}; my $pid= $self->{SAFE_PID};
die "Can't cet core from not started process" unless defined $pid; die "Can't get core from not started process" unless defined $pid;
_verbose("Sending ABRT to $self"); _verbose("Sending ABRT to $self");
kill ("ABRT", $pid); kill ("ABRT", $pid);
return 1; return 1;
......
...@@ -356,6 +356,7 @@ my $source_dist= -d "../sql"; ...@@ -356,6 +356,7 @@ my $source_dist= -d "../sql";
my $opt_max_save_core= env_or_val(MTR_MAX_SAVE_CORE => 5); my $opt_max_save_core= env_or_val(MTR_MAX_SAVE_CORE => 5);
my $opt_max_save_datadir= env_or_val(MTR_MAX_SAVE_DATADIR => 20); my $opt_max_save_datadir= env_or_val(MTR_MAX_SAVE_DATADIR => 20);
my $opt_max_test_fail= env_or_val(MTR_MAX_TEST_FAIL => 10); my $opt_max_test_fail= env_or_val(MTR_MAX_TEST_FAIL => 10);
my $opt_core_on_failure= 0;
my $opt_parallel= $ENV{MTR_PARALLEL} || 1; my $opt_parallel= $ENV{MTR_PARALLEL} || 1;
...@@ -1165,6 +1166,7 @@ sub command_line_setup { ...@@ -1165,6 +1166,7 @@ sub command_line_setup {
'max-save-core=i' => \$opt_max_save_core, 'max-save-core=i' => \$opt_max_save_core,
'max-save-datadir=i' => \$opt_max_save_datadir, 'max-save-datadir=i' => \$opt_max_save_datadir,
'max-test-fail=i' => \$opt_max_test_fail, 'max-test-fail=i' => \$opt_max_test_fail,
'core-on-failure' => \$opt_core_on_failure,
# Coverage, profiling etc # Coverage, profiling etc
'gcov' => \$opt_gcov, 'gcov' => \$opt_gcov,
...@@ -5231,7 +5233,9 @@ sub after_failure ($) { ...@@ -5231,7 +5233,9 @@ sub after_failure ($) {
sub report_failure_and_restart ($) { sub report_failure_and_restart ($) {
my $tinfo= shift; my $tinfo= shift;
if ($opt_valgrind_mysqld && ($tinfo->{'warnings'} || $tinfo->{'timeout'})) { if ($opt_valgrind_mysqld && ($tinfo->{'warnings'} || $tinfo->{'timeout'}) &&
$opt_core_on_failure == 0)
{
# In these cases we may want valgrind report from normal termination # In these cases we may want valgrind report from normal termination
$tinfo->{'dont_kill_server'}= 1; $tinfo->{'dont_kill_server'}= 1;
} }
...@@ -5891,6 +5895,13 @@ sub start_mysqltest ($) { ...@@ -5891,6 +5895,13 @@ sub start_mysqltest ($) {
mtr_add_arg($args, "--sleep=%d", $opt_sleep); mtr_add_arg($args, "--sleep=%d", $opt_sleep);
} }
if ( $opt_valgrind_mysqld )
{
# We are running server under valgrind, which causes some replication
# test to be much slower, notable rpl_mdev6020. Increase timeout.
mtr_add_arg($args, "--wait-for-pos-timeout=1500");
}
if ( $opt_ssl ) if ( $opt_ssl )
{ {
# Turn on SSL for _all_ test cases if option --ssl was used # Turn on SSL for _all_ test cases if option --ssl was used
...@@ -6533,6 +6544,7 @@ Options for debugging the product ...@@ -6533,6 +6544,7 @@ Options for debugging the product
the current test run. Defaults to the current test run. Defaults to
$opt_max_test_fail, set to 0 for no limit. Set $opt_max_test_fail, set to 0 for no limit. Set
it's default with MTR_MAX_TEST_FAIL it's default with MTR_MAX_TEST_FAIL
core-in-failure Generate a core even if run server is run with valgrind
Options for valgrind Options for valgrind
......
...@@ -9539,11 +9539,6 @@ PSI_stage_info stage_waiting_for_the_next_event_in_relay_log= { 0, "Waiting for ...@@ -9539,11 +9539,6 @@ PSI_stage_info stage_waiting_for_the_next_event_in_relay_log= { 0, "Waiting for
PSI_stage_info stage_waiting_for_the_slave_thread_to_advance_position= { 0, "Waiting for the slave SQL thread to advance position", 0}; PSI_stage_info stage_waiting_for_the_slave_thread_to_advance_position= { 0, "Waiting for the slave SQL thread to advance position", 0};
PSI_stage_info stage_waiting_to_finalize_termination= { 0, "Waiting to finalize termination", 0}; PSI_stage_info stage_waiting_to_finalize_termination= { 0, "Waiting to finalize termination", 0};
PSI_stage_info stage_waiting_to_get_readlock= { 0, "Waiting to get readlock", 0}; PSI_stage_info stage_waiting_to_get_readlock= { 0, "Waiting to get readlock", 0};
PSI_stage_info stage_slave_waiting_workers_to_exit= { 0, "Waiting for workers to exit", 0};
PSI_stage_info stage_slave_waiting_worker_to_release_partition= { 0, "Waiting for Slave Worker to release partition", 0};
PSI_stage_info stage_slave_waiting_worker_to_free_events= { 0, "Waiting for Slave Workers to free pending events", 0};
PSI_stage_info stage_slave_waiting_worker_queue= { 0, "Waiting for Slave Worker queue", 0};
PSI_stage_info stage_slave_waiting_event_from_coordinator= { 0, "Waiting for an event from Coordinator", 0};
PSI_stage_info stage_binlog_waiting_background_tasks= { 0, "Waiting for background binlog tasks", 0}; PSI_stage_info stage_binlog_waiting_background_tasks= { 0, "Waiting for background binlog tasks", 0};
PSI_stage_info stage_binlog_processing_checkpoint_notify= { 0, "Processing binlog checkpoint notification", 0}; PSI_stage_info stage_binlog_processing_checkpoint_notify= { 0, "Processing binlog checkpoint notification", 0};
PSI_stage_info stage_binlog_stopping_background_thread= { 0, "Stopping binlog background thread", 0}; PSI_stage_info stage_binlog_stopping_background_thread= { 0, "Stopping binlog background thread", 0};
...@@ -9637,11 +9632,6 @@ PSI_stage_info *all_server_stages[]= ...@@ -9637,11 +9632,6 @@ PSI_stage_info *all_server_stages[]=
& stage_setup, & stage_setup,
& stage_show_explain, & stage_show_explain,
& stage_slave_has_read_all_relay_log, & stage_slave_has_read_all_relay_log,
& stage_slave_waiting_event_from_coordinator,
& stage_slave_waiting_worker_queue,
& stage_slave_waiting_worker_to_free_events,
& stage_slave_waiting_worker_to_release_partition,
& stage_slave_waiting_workers_to_exit,
& stage_sorting, & stage_sorting,
& stage_sorting_for_group, & stage_sorting_for_group,
& stage_sorting_for_order, & stage_sorting_for_order,
......
...@@ -443,11 +443,6 @@ extern PSI_stage_info stage_waiting_for_the_next_event_in_relay_log; ...@@ -443,11 +443,6 @@ extern PSI_stage_info stage_waiting_for_the_next_event_in_relay_log;
extern PSI_stage_info stage_waiting_for_the_slave_thread_to_advance_position; extern PSI_stage_info stage_waiting_for_the_slave_thread_to_advance_position;
extern PSI_stage_info stage_waiting_to_finalize_termination; extern PSI_stage_info stage_waiting_to_finalize_termination;
extern PSI_stage_info stage_waiting_to_get_readlock; extern PSI_stage_info stage_waiting_to_get_readlock;
extern PSI_stage_info stage_slave_waiting_worker_to_release_partition;
extern PSI_stage_info stage_slave_waiting_worker_to_free_events;
extern PSI_stage_info stage_slave_waiting_worker_queue;
extern PSI_stage_info stage_slave_waiting_event_from_coordinator;
extern PSI_stage_info stage_slave_waiting_workers_to_exit;
extern PSI_stage_info stage_binlog_waiting_background_tasks; extern PSI_stage_info stage_binlog_waiting_background_tasks;
extern PSI_stage_info stage_binlog_processing_checkpoint_notify; extern PSI_stage_info stage_binlog_processing_checkpoint_notify;
extern PSI_stage_info stage_binlog_stopping_background_thread; extern PSI_stage_info stage_binlog_stopping_background_thread;
......
...@@ -6063,7 +6063,7 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi, ...@@ -6063,7 +6063,7 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
#endif #endif
ulong client_flag= CLIENT_REMEMBER_OPTIONS; ulong client_flag= CLIENT_REMEMBER_OPTIONS;
if (opt_slave_compressed_protocol) if (opt_slave_compressed_protocol)
client_flag=CLIENT_COMPRESS; /* We will use compression */ client_flag|= CLIENT_COMPRESS; /* We will use compression */
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *) &slave_net_timeout); mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *) &slave_net_timeout);
mysql_options(mysql, MYSQL_OPT_READ_TIMEOUT, (char *) &slave_net_timeout); mysql_options(mysql, MYSQL_OPT_READ_TIMEOUT, (char *) &slave_net_timeout);
......
...@@ -190,6 +190,12 @@ size_t vio_read(Vio *vio, uchar *buf, size_t size) ...@@ -190,6 +190,12 @@ size_t vio_read(Vio *vio, uchar *buf, size_t size)
{ {
DBUG_PRINT("vio_error", ("Got error %d during read", errno)); DBUG_PRINT("vio_error", ("Got error %d during read", errno));
} }
#ifndef DEBUG_DATA_PACKETS
else
{
DBUG_DUMP("read_data", buf, ret);
}
#endif /* DEBUG_DATA_PACKETS */
#endif /* DBUG_OFF */ #endif /* DBUG_OFF */
DBUG_PRINT("exit", ("%d", (int) ret)); DBUG_PRINT("exit", ("%d", (int) ret));
DBUG_RETURN(ret); DBUG_RETURN(ret);
...@@ -416,6 +422,13 @@ int vio_blocking(Vio *vio, my_bool set_blocking_mode, my_bool *old_mode) ...@@ -416,6 +422,13 @@ int vio_blocking(Vio *vio, my_bool set_blocking_mode, my_bool *old_mode)
DBUG_RETURN(r); DBUG_RETURN(r);
} }
/*
Check if vio is blocking
@retval 0 is not blocking
@retval 1 is blocking
*/
my_bool my_bool
vio_is_blocking(Vio * vio) vio_is_blocking(Vio * vio)
{ {
...@@ -570,7 +583,9 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive) ...@@ -570,7 +583,9 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive)
my_bool my_bool
vio_should_retry(Vio *vio) vio_should_retry(Vio *vio)
{ {
return (vio_errno(vio) == SOCKET_EINTR); DBUG_ENTER("vio_should_retry");
DBUG_PRINT("info", ("vio_errno: %d", vio_errno(vio)));
DBUG_RETURN(vio_errno(vio) == SOCKET_EINTR);
} }
...@@ -595,6 +610,7 @@ int vio_close(Vio *vio) ...@@ -595,6 +610,7 @@ int vio_close(Vio *vio)
{ {
int r=0; int r=0;
DBUG_ENTER("vio_close"); DBUG_ENTER("vio_close");
DBUG_PRINT("enter", ("sd: %d", mysql_socket_getfd(vio->mysql_socket)));
if (vio->type != VIO_CLOSED) if (vio->type != VIO_CLOSED)
{ {
...@@ -927,6 +943,7 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout) ...@@ -927,6 +943,7 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout)
my_socket sd= mysql_socket_getfd(vio->mysql_socket); my_socket sd= mysql_socket_getfd(vio->mysql_socket);
MYSQL_SOCKET_WAIT_VARIABLES(locker, state) /* no ';' */ MYSQL_SOCKET_WAIT_VARIABLES(locker, state) /* no ';' */
DBUG_ENTER("vio_io_wait"); DBUG_ENTER("vio_io_wait");
DBUG_PRINT("enter", ("timeout: %d", timeout));
/* /*
Note that if zero timeout, then we will not block, so we do not need to Note that if zero timeout, then we will not block, so we do not need to
...@@ -938,7 +955,10 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout) ...@@ -938,7 +955,10 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout)
PSI_SOCKET_SELECT, timeout); PSI_SOCKET_SELECT, timeout);
ret= my_io_wait_async(vio->async_context, event, timeout); ret= my_io_wait_async(vio->async_context, event, timeout);
if (ret == 0) if (ret == 0)
{
DBUG_PRINT("info", ("timeout"));
errno= SOCKET_ETIMEDOUT; errno= SOCKET_ETIMEDOUT;
}
END_SOCKET_WAIT(locker,timeout); END_SOCKET_WAIT(locker,timeout);
DBUG_RETURN(ret); DBUG_RETURN(ret);
} }
...@@ -972,6 +992,7 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout) ...@@ -972,6 +992,7 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout)
switch ((ret= poll(&pfd, 1, timeout))) switch ((ret= poll(&pfd, 1, timeout)))
{ {
case -1: case -1:
DBUG_PRINT("error", ("poll returned -1"));
/* On error, -1 is returned. */ /* On error, -1 is returned. */
break; break;
case 0: case 0:
...@@ -979,6 +1000,7 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout) ...@@ -979,6 +1000,7 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout)
Set errno to indicate a timeout error. Set errno to indicate a timeout error.
(This is not compiled in on WIN32.) (This is not compiled in on WIN32.)
*/ */
DBUG_PRINT("info", ("poll timeout"));
errno= SOCKET_ETIMEDOUT; errno= SOCKET_ETIMEDOUT;
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment