Bug #44181 CHANGE MASTER complains Could not initialize master info
Submitted: 9 Apr 2009 8:33 Modified: 25 Aug 2009 3:15
Reporter: Andrei Elkin Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.1+ OS:Any
Assigned to: Daogang Qu CPU Architecture:Any
Tags: RESET SLAVE

[9 Apr 2009 8:33] Andrei Elkin
Description:
CHANGE MASTER can't make it if before RESET SLAVE failed at purging
relay log files (see  Bug #44179).

ERROR 1201 (HY000): Could not initialize master info structure
or
ERROR 29 (HY000): File './slave-relay-bin.000001' not found (Errcode:2)

persist even if RESET SLAVE and restart the slave server are
attempted.

There seems to be only manual removing of obsolate slave info files
can help.

How to repeat:
mysql> RESET SLAVE /*  and simulate an error inside
my_delete_allow_opened() -> my_delete() as bug#44179 instucts */;

There might be a crash as bug#44179 reported. At restart:

mysql> change master to master_host='dummy';
ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log

mysql> reset slave;
Query OK, 0 rows affected (5.07 sec)
or restart,

and again

mysql> change master to master_host='dummy';
ERROR 29 (HY000): File './slave-relay-bin.000001' not found (Errcode: 2)
[22 Aug 2009 10:45] Daogang Qu
The problem can't be reproduced. Please review the following test:

daogangq@daogangq-laptop:~/mysql/bzrwork/bug44181/mysql-5.1-bugteam/mysql-test$ ./mtr --start rpl_view
Logging: ./mtr  --start rpl_view
090822 13:46:52 [Note] Plugin 'FEDERATED' is disabled.
090822 13:46:52 [Note] Plugin 'ndbcluster' is disabled.
090822 13:46:52 [Warning] Forcing shutdown of 2 plugins
MySQL Version 5.1.39
Checking supported features...
 - using ndbcluster when necessary, mysqld supports it
 - SSL connections supported
 - binaries are debug compiled
Collecting tests...
 - adding combinations for rpl
vardir: /home/daogangq/mysql/bzrwork/bug44181/mysql-5.1-bugteam/mysql-test/var
Checking leftover processes...
 - found old pid 18878 in 'mysqld.1.pid', killing it...
   process did not exist!
 - found old pid 18881 in 'mysqld.2.pid', killing it...
   process did not exist!
Removing old var directory...
Creating var directory '/home/daogangq/mysql/bzrwork/bug44181/mysql-5.1-bugteam/mysql-test/var'...
Installing system database...
Using server port 36857
worker[1]  - 'localhost:13000' was not free
worker[1]  - 'localhost:13010' was not free
worker[1]  - 'localhost:13020' was not free
worker[1]  - 'localhost:13030' was not free
worker[1]  - 'localhost:13040' was not free
worker[1]  - 'localhost:13050' was not free
worker[1]  - 'localhost:13060' was not free
worker[1]  - 'localhost:13070' was not free
worker[1]  - 'localhost:13080' was not free
worker[1]  - 'localhost:13090' was not free
worker[1]  - 'localhost:13100' was not free
worker[1]  - 'localhost:13110' was not free
worker[1]  - 'localhost:13120' was not free
worker[1]  - 'localhost:13130' was not free
worker[1]  - 'localhost:13140' was not free
worker[1] Using MTR_BUILD_THREAD 315, with reserved ports 13150..13159

==============================================================================

TEST                                      RESULT   TIME (ms)
------------------------------------------------------------

worker[1] 
Started [mysqld.1 - pid: 19312, winpid: 19312] [mysqld.2 - pid: 19315, winpid: 19315]
worker[1] Waiting for server(s) to exit...
       

                                                             
daogangq@daogangq-laptop:~/mysql/bzrwork/bug44181/mysql-5.1-bugteam/mysql-test$ ../client/mysql -u root -S var/tmp/mysqld.1.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.39-debug-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> RESET SLAVE;
Query OK, 0 rows affected (0.00 sec)

mysql> change master to master_host='dummy';
Query OK, 0 rows affected (0.20 sec)

mysql> RESET SLAVE;
Query OK, 0 rows affected (0.16 sec)

mysql> change master to master_host='dummy';
Query OK, 0 rows affected (0.18 sec)

mysql> 

daogangq@daogangq-laptop:~/mysql/bzrwork/bug44181/mysql-5.1-bugteam/mysql-test$ ../client/mysql -u root --socket=var/tmp/mysqld.2.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.39-debug-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> reset slave;
Query OK, 0 rows affected (0.13 sec)

mysql> change master to master_host='dummy';
Query OK, 0 rows affected (0.17 sec)

mysql> reset slave;
Query OK, 0 rows affected (0.15 sec)

mysql> change master to master_host='dummy';
Query OK, 0 rows affected (0.19 sec)

mysql>
[24 Aug 2009 8:39] Andrei Elkin
Could not reproduce anymore. Possibly Bug #44179 and other fixes refined that
execution path.