mysqld: Sort aborted: Server shutdown in progress

jx_yu發表於2016-03-23

上午發現mysql資料庫errlog裡面有報錯:

[ERROR] /usr/sbin/mysqld: Sort aborted: Server shutdown in progress

相關如下

#err-log發現有ERROR異常

~]$ sudo tail -f /data/mysql/data/DBanalysis02.err|grep i error         
2016-02-19 16:51:13 8769 [ERROR] /usr/sbin/mysqld: Sort aborted: Server shutdown in progress
#但是檢視mysql例項uptime發現並沒有重啟過,而且errlog裡面也看不到例項restart的資訊

~]$ mysql -uroot -p -e "status"|grep time
Enter password:
Uptime:                 160 days 12 hours 26 min 8 sec

# 資料庫版本5.6.11
?~]$ mysql -V
mysql  Ver 14.14 Distrib 5.6.11, for Linux (x86_64) using  EditLine wrapper

~]$ mysql -uroot -p -e "select version()"

Enter password:

+------------+

| version()  |

+------------+

| 5.6.11-log |

+------------+
#OS版本 

~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.1 (Santiago)

說明

查閱相關錯誤資料,發現這是Mysqlbug,在之前某些版本中有下面2種情況會丟擲[ERROR] /usr/sbin/mysqld: Sort aborted: Server shutdown in progress異常:

1、在查詢執行排序的過程中例項確實進行了重啟,導致查詢中斷。

2、在查詢執行排序的過程中,透過 kill thread功能終止了查詢的會話。

 

於是,在測試環境試了一把,如下:

#Mysql 5.6.11版本下

clip_image002

在執行有Using filesort操作的SQL過程中,在別的會話透過processlist看到正在執行的SQL語句的thread id,使用kill threaded 操作終止查詢,在執行查詢的語句下面會顯示:ERROR 2013 (HY000): Lost connection to MySQL server during query

同時,在errlog下則丟擲了:

2016-03-23 14:09:32 2414 [ERROR] /usr/sbin/mysqld: Sort aborted: Server shutdown in progress 異常。

#Mysql 5.6.22版本下

重複上面的操作,errlog丟擲的異常是:

clip_image004

並且 Using filesort操作SQL執行的過程中,restart mysqlerrlog也是丟擲同樣的錯誤。

 

最終結論

在某些Mysql版本中

[ERROR] /usr/sbin/mysqld: Sort aborted: Server shutdown in progress可能有2種情況丟擲異常:

1、在查詢執行排序的過程中例項確實進行了重啟,導致查詢中斷。

2、在查詢執行排序的過程中,透過 kill thread功能終止了查詢的會話。

當出現此異常時,可以檢視mysql例項的uptimeerrlog等資訊來確定mysqld是否真的crash過,如果沒有crash(第2種情況),則是MysqlBug導致丟擲的異常資訊,可以忽略。

 

參考:

https://www.percona.com/blog/2013/12/30/error-mysqld-sort-aborted-server-shutdown-in-progress/

 

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27000195/viewspace-2062549/,如需轉載,請註明出處,否則將追究法律責任。

相關文章