• Praveenkumar Hulakund's avatar
    Bug#11745656 - KILL THREAD -> ERROR: "SERVER SHUTDOWN IN PROGRESS" · c904103b
    Praveenkumar Hulakund authored
    Description:
    ------------
    There are 2 issues reported in the bug report,
    
    1. One session running a "long" select, then, from the other
    session, you kill that first one, while select is
    running, and it receives that message "Server shutdown in
    progress".
    Reported Date: 02-Apr-2006
    
    => Looks like this isuse is already fixed in 2009 by the patch
       pushed for bug28141. 
    
    2. Killing query which goes to filesort, logs error entries like:
    
    120416  9:17:28 [ERROR] mysqld: Sort aborted: Server shutdown in
                                                  progress 
    120416  9:18:48 [ERROR] mysqld: Sort aborted: Server shutdown in
                                                  progress 
    120416  9:19:39 [ERROR] mysqld: Sort aborted: Server shutdown in
                                                  progress 
    Reported Date: 16-Apr-2012                                              
    
    => This issue is introduced in 5.5+ versions. Fixing this issue
       in this patch.
    
    
    Analysis:
    ---------
    In function "filesort()", on error we are logging error message.
    To the error message, the message related THD::killed_errno is
    also appeneded, if it is set.(THD::kill_errno value is obtained
    by calling member function THD::killed_errno)
    
    In the scenario mentioned in this bug report, when we kill the
    connection, THD::kill_errno is set to the THD::KILL_CONNECTION.
    Enum type THD::KILL_CONNECTION corressponds to value 
    ER_SERVER_SHUTDOWN. Because of this, "Server shutdown in ...." is
    appended to the message logged.
    
    Fix:
    ----
    Modified code of "filesort()" function to append "KILL_QUERY"
    status to error message when thread is killed and server
    shutdown is not in progress.
    c904103b
filesort.cc 49.5 KB