Commit 74cabf4e authored by unknown's avatar unknown
Browse files

Merge mysql.com:/home/alik/MySQL/devel/5.0-tree

into  mysql.com:/home/alik/MySQL/devel/5.0-rt


mysql-test/mysql-test-run.pl:
  Auto merged
sql/sql_insert.cc:
  Auto merged
parents 5d9b5f5e 645e3135
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -890,19 +890,28 @@ sub mtr_kill_processes ($) {
sub mtr_kill_process ($$$$) {
  my $pid= shift;
  my $signal= shift;
  my $retries= shift;
  my $total_retries= shift;
  my $timeout= shift;

  while (1)
  for (my $cur_attempt= 1; $cur_attempt <= $total_retries; ++$cur_attempt)
  {
    mtr_debug("Sending $signal to $pid...");

    kill($signal, $pid);

    last unless kill (0, $pid) and $retries--;
    unless (kill (0, $pid))
    {
      mtr_debug("Process $pid died.");
      return;
    }

    mtr_debug("Sleep $timeout second waiting for processes to die");
    mtr_debug("Sleeping $timeout second(s) waiting for processes to die...");

    sleep($timeout);
  }

  mtr_debug("Process $pid is still alive after $total_retries " .
            "of sending signal $signal.");
}

##############################################################################
+48 −6
Original line number Diff line number Diff line
@@ -2860,22 +2860,58 @@ sub im_stop($) {

  # Try graceful shutdown.

  mtr_debug("IM-main pid: $instance_manager->{'pid'}");
  mtr_debug("Stopping IM-main...");

  mtr_kill_process($instance_manager->{'pid'}, 'TERM', 10, 1);

  # If necessary, wait for angel process to die.

  if (defined $instance_manager->{'angel_pid'})
  {
    mtr_debug("IM-angel pid: $instance_manager->{'angel_pid'}");
    mtr_debug("Waiting for IM-angel to die...");

    my $total_attempts= 10;

    for (my $cur_attempt=1; $cur_attempt <= $total_attempts; ++$cur_attempt)
    {
      unless (kill (0, $instance_manager->{'angel_pid'}))
      {
        mtr_debug("IM-angel died.");
        last;
      }

      sleep(1);
    }
  }

  # Check that all processes died.

  my $clean_shutdown= 0;

  while (1)
  {
    last if kill (0, $instance_manager->{'pid'});
    if (kill (0, $instance_manager->{'pid'}))
    {
      mtr_debug("IM-main is still alive.");
      last;
    }

    last if (defined $instance_manager->{'angel_pid'}) &&
            kill (0, $instance_manager->{'angel_pid'});
    if (defined $instance_manager->{'angel_pid'} &&
        kill (0, $instance_manager->{'angel_pid'}))
    {
      mtr_debug("IM-angel is still alive.");
      last;
    }

    foreach my $pid (@mysqld_pids)
    {
      last if kill (0, $pid);
      if (kill (0, $pid))
      {
        mtr_debug("Guarded mysqld ($pid) is still alive.");
        last;
      }
    }

    $clean_shutdown= 1;
@@ -2886,15 +2922,21 @@ sub im_stop($) {

  unless ($clean_shutdown)
  {

    if (defined $instance_manager->{'angel_pid'})
    {
      mtr_debug("Killing IM-angel...");
      mtr_kill_process($instance_manager->{'angel_pid'}, 'KILL', 10, 1)
      if defined $instance_manager->{'angel_pid'};
    }
    
    mtr_debug("Killing IM-main...");
    mtr_kill_process($instance_manager->{'pid'}, 'KILL', 10, 1);

    # Shutdown managed mysqld-processes. Some of them may be nonguarded, so IM
    # will not stop them on shutdown. So, we should firstly try to end them
    # legally.

    mtr_debug("Killing guarded mysqld(s)...");
    mtr_kill_processes(\@mysqld_pids);

    # Complain in error log so that a warning will be shown.
+1 −0
Original line number Diff line number Diff line
Success: the process has been started.
SHOW INSTANCES;
instance_name	status
mysqld1	online
+41 −35
Original line number Diff line number Diff line

--------------------------------------------------------------------
-- 1.1.1.
--------------------------------------------------------------------
Success: the process has been started.
SHOW INSTANCES;
instance_name	status
mysqld1	online
mysqld2	offline
SHOW INSTANCE STATUS mysqld1;
instance_name	status	version
mysqld1	online	VERSION
SHOW INSTANCE STATUS mysqld2;
instance_name	status	version
mysqld2	offline	VERSION

--------------------------------------------------------------------
-- 1.1.2.
--------------------------------------------------------------------
START INSTANCE mysqld2;
SHOW INSTANCES;
instance_name	status
mysqld1	online
mysqld2	online
SHOW INSTANCE STATUS mysqld1;
instance_name	status	version
mysqld1	online	VERSION
SHOW INSTANCE STATUS mysqld2;
instance_name	status	version
mysqld2	online	VERSION
Success: the process has been started.
SHOW VARIABLES LIKE 'port';
Variable_name	Value
port	IM_MYSQLD1_PORT
port	IM_MYSQLD2_PORT

--------------------------------------------------------------------
-- 1.1.3.
--------------------------------------------------------------------
STOP INSTANCE mysqld2;
SHOW INSTANCES;
instance_name	status
mysqld1	online
mysqld2	offline
SHOW INSTANCE STATUS mysqld1;
instance_name	status	version
mysqld1	online	VERSION
SHOW INSTANCE STATUS mysqld2;
instance_name	status	version
mysqld2	offline	VERSION
Success: the process has been stopped.

--------------------------------------------------------------------
-- 1.1.4.
--------------------------------------------------------------------
START INSTANCE mysqld3;
ERROR HY000: Bad instance name. Check that the instance with such a name exists
START INSTANCE mysqld1;
ERROR HY000: The instance is already started

--------------------------------------------------------------------
-- 1.1.5.
--------------------------------------------------------------------
STOP INSTANCE mysqld3;
ERROR HY000: Bad instance name. Check that the instance with such a name exists

--------------------------------------------------------------------
-- 1.1.6.
--------------------------------------------------------------------
SHOW INSTANCES;
instance_name	status
mysqld1	online
@@ -50,20 +51,25 @@ SHOW INSTANCES;
instance_name	status
mysqld1	online
mysqld2	offline

--------------------------------------------------------------------
-- 1.1.7.
--------------------------------------------------------------------
START INSTANCE mysqld2;
SHOW INSTANCES;
instance_name	status
mysqld1	online
mysqld2	online
Success: the process has been started.
Killing the process...
Sleeping...
Success: the process was killed.
SHOW INSTANCES;
instance_name	status
mysqld1	online
mysqld2	offline

--------------------------------------------------------------------
-- 1.1.8.
--------------------------------------------------------------------
SHOW INSTANCE STATUS;
ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use

--------------------------------------------------------------------
-- BUG#12813
--------------------------------------------------------------------
START INSTANCE mysqld1,mysqld2,mysqld3;
ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
STOP INSTANCE mysqld1,mysqld2,mysqld3;
+3 −0
Original line number Diff line number Diff line
Success: the process has been started.
SHOW INSTANCES;
instance_name	status
mysqld1	online
@@ -42,7 +43,9 @@ skip-innodb VALUE
skip-bdb	VALUE
skip-ndbcluster	VALUE
START INSTANCE mysqld2;
Success: the process has been started.
STOP INSTANCE mysqld2;
Success: the process has been stopped.
SHOW mysqld1 LOG FILES;
Logfile	Path	File size
ERROR LOG	PATH	FILE_SIZE
Loading