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 {
my ($self)= @_;
return if IS_WINDOWS;
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");
kill ("ABRT", $pid);
return 1;
......
......@@ -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_datadir= env_or_val(MTR_MAX_SAVE_DATADIR => 20);
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;
......@@ -1165,6 +1166,7 @@ sub command_line_setup {
'max-save-core=i' => \$opt_max_save_core,
'max-save-datadir=i' => \$opt_max_save_datadir,
'max-test-fail=i' => \$opt_max_test_fail,
'core-on-failure' => \$opt_core_on_failure,
# Coverage, profiling etc
'gcov' => \$opt_gcov,
......@@ -4565,7 +4567,7 @@ sub run_testcase ($$) {
}
# Try to dump core for mysqltest and all servers
foreach my $proc ($test, started(all_servers()))
foreach my $proc ($test, started(all_servers()))
{
mtr_print("Trying to dump core for $proc");
if ($proc->dump_core())
......@@ -5231,7 +5233,9 @@ sub after_failure ($) {
sub report_failure_and_restart ($) {
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
$tinfo->{'dont_kill_server'}= 1;
}
......@@ -5891,6 +5895,13 @@ sub start_mysqltest ($) {
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 )
{
# Turn on SSL for _all_ test cases if option --ssl was used
......@@ -6533,6 +6544,7 @@ Options for debugging the product
the current test run. Defaults to
$opt_max_test_fail, set to 0 for no limit. Set
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
......
......@@ -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_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_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_processing_checkpoint_notify= { 0, "Processing binlog checkpoint notification", 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[]=
& stage_setup,
& stage_show_explain,
& 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_for_group,
& stage_sorting_for_order,
......
......@@ -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_to_finalize_termination;
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_processing_checkpoint_notify;
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,
#endif
ulong client_flag= CLIENT_REMEMBER_OPTIONS;
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_READ_TIMEOUT, (char *) &slave_net_timeout);
......
......@@ -2981,12 +2981,12 @@ class THD :public Statement,
set_start_time();
start_utime= utime_after_lock= microsecond_interval_timer();
}
inline void set_time(my_hrtime_t t)
inline void set_time(my_hrtime_t t)
{
user_time= t;
set_time();
}
inline void set_time(my_time_t t, ulong sec_part)
inline void set_time(my_time_t t, ulong sec_part)
{
my_hrtime_t hrtime= { hrtime_from_time(t) + sec_part };
set_time(hrtime);
......
......@@ -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));
}
#ifndef DEBUG_DATA_PACKETS
else
{
DBUG_DUMP("read_data", buf, ret);
}
#endif /* DEBUG_DATA_PACKETS */
#endif /* DBUG_OFF */
DBUG_PRINT("exit", ("%d", (int) ret));
DBUG_RETURN(ret);
......@@ -416,6 +422,13 @@ int vio_blocking(Vio *vio, my_bool set_blocking_mode, my_bool *old_mode)
DBUG_RETURN(r);
}
/*
Check if vio is blocking
@retval 0 is not blocking
@retval 1 is blocking
*/
my_bool
vio_is_blocking(Vio * vio)
{
......@@ -570,7 +583,9 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive)
my_bool
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,8 +610,9 @@ int vio_close(Vio *vio)
{
int r=0;
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)
{
DBUG_ASSERT(vio->type == VIO_TYPE_TCPIP ||
vio->type == VIO_TYPE_SOCKET ||
......@@ -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);
MYSQL_SOCKET_WAIT_VARIABLES(locker, state) /* no ';' */
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
......@@ -938,7 +955,10 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout)
PSI_SOCKET_SELECT, timeout);
ret= my_io_wait_async(vio->async_context, event, timeout);
if (ret == 0)
{
DBUG_PRINT("info", ("timeout"));
errno= SOCKET_ETIMEDOUT;
}
END_SOCKET_WAIT(locker,timeout);
DBUG_RETURN(ret);
}
......@@ -972,6 +992,7 @@ int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout)
switch ((ret= poll(&pfd, 1, timeout)))
{
case -1:
DBUG_PRINT("error", ("poll returned -1"));
/* On error, -1 is returned. */
break;
case 0:
......@@ -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.
(This is not compiled in on WIN32.)
*/
DBUG_PRINT("info", ("poll timeout"));
errno= SOCKET_ETIMEDOUT;
break;
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