mariadb/scripts
Anirudh Mangipudi 638dcdc3fb Bug #16776528 RACE CONDITION CAN CAUSE MYSQLD TO REMOVE SOCKET FILE ERRANTLY
Problem Description:
A mysqld_safe instance is started. An InnoDB crash recovery begins which takes
few seconds to complete. During this crash recovery process happening, another
mysqld_safe instance is started with the same server startup parameters. Since
the mysqld's pid file is absent during the crash recovery process the second
instance assumes there is no other process and tries to acquire a lock on the
ibdata files in the datadir.  But this step fails and the 2nd instance keeps 
retrying 100 times each with a delay of 1 second. Now after the 100 attempts, 
the server goes down, but while going down it hits the mysqld_safe script's 
cleanup section and without any check it blindly deletes the socket and pid 
files. Since no lock is placed on the socket file, it gets deleted.

Solution:
We create a mysqld_safe.pid file in the datadir, which protects the presence 
server instance resources by storing the mysqld_safe's process id in it. We
place a check if the mysqld_safe.pid file is existing in the datadir. If yes
then we check if the pid it contains is an active pid or not. If yes again,
then the scripts logs an error saying "A mysqld_safe instance is already 
running". Otherwise it will log the present mysqld_safe's pid into the 
mysqld_safe.pid file.
2013-08-12 23:06:58 +05:30
..
CMakeLists.txt Updated/added copyright headers. 2013-02-25 15:26:00 +01:00
comp_sql.c Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 15:53:48 +01:00
dheadgen.pl Updated/added copyright headers 2011-06-30 17:46:53 +02:00
fill_help_tables.sql Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 15:53:48 +01:00
msql2mysql.sh gen_lex_hash.cc: 2007-01-31 00:06:42 +01:00
mysql_config.pl.in Updated/added copyright headers 2011-06-30 17:46:53 +02:00
mysql_config.sh Updated/added copyright headers 2011-06-30 17:46:53 +02:00
mysql_convert_table_format.sh Updated/added copyright headers 2011-06-30 17:37:13 +02:00
mysql_find_rows.sh Updated/added copyright headers 2011-06-30 17:31:31 +02:00
mysql_fix_extensions.sh Updated/added copyright headers 2011-06-30 17:31:31 +02:00
mysql_install_db.pl.in Updated/added copyright headers. 2013-02-25 15:26:00 +01:00
mysql_install_db.sh Updated/added copyright headers 2012-02-16 10:48:16 +01:00
mysql_secure_installation.pl.in Bug#13741677 MYSQL_SECURE_INSTALLATION DOES NOT 2012-07-26 21:47:03 +05:30
mysql_secure_installation.sh Bug#13741677 MYSQL_SECURE_INSTALLATION DOES NOT 2012-07-26 21:47:03 +05:30
mysql_setpermission.sh Updated/added copyright headers 2011-06-30 17:37:13 +02:00
mysql_system_tables.sql Merge of patch for Bug#12671635 from mysql-5.1. 2013-03-21 23:40:25 +05:30
mysql_system_tables_data.sql Merge from mysq-5.1 to mysql-5.5 2013-02-19 14:36:30 +05:30
mysql_system_tables_fix.sql Updated/added copyright headers 2011-06-30 17:46:53 +02:00
mysql_test_data_timezone.sql Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 15:53:48 +01:00
mysql_zap.sh Updated/added copyright headers 2011-06-30 17:37:13 +02:00
mysqlaccess.conf merge 2010-08-20 09:12:36 -05:00
mysqlaccess.sh Updated/added copyright headers 2011-06-30 17:31:31 +02:00
mysqlbug.sh Updated/added copyright headers. 2013-02-25 15:26:00 +01:00
mysqld_multi.sh Updated/added copyright headers. 2013-02-25 15:26:00 +01:00
mysqld_safe.sh Bug #16776528 RACE CONDITION CAN CAUSE MYSQLD TO REMOVE SOCKET FILE ERRANTLY 2013-08-12 23:06:58 +05:30
mysqldumpslow.sh Updated/added copyright headers 2011-06-30 17:37:13 +02:00
mysqlhotcopy.sh Bug #12992993 MYSQLHOTCOPY FAILS IF VIEW EXISTS 2012-08-14 15:13:30 +05:30