MySQL replication — issue with mysql.proc during replication from 5.0 to 5.5 host
-
31-10-2019 - |
Question
We are replicating from a mysql 5.0.45 host to a 5.5.26 host over WAN. Every once in a while one of our databases does not accept a query and halts the replication.
"'Column count of mysql.proc is wrong. Expected 20, found 16. The table is probably corrupted' on query."
I found some useful information from this posting, but not specifically about replication. It seems like if you are upgrading, then you need to do the mysql_upgrade (with --force if needed) on that table. My guess is that the replication from 5.0 to 5.5 is like an upgrade...all of the time. So how would I do a mysql_upgrade here? If I do the upgrade followed by a slave start, will it be flushed out immediately as the data is still coming from a master without the upgrade?
Resolving issue with mysql.proc after upgrading MySQL from 5.0.* to 5.1.*
mysql> show slave status\G
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
*************************** 1. row ***************************
Slave_IO_State: Connecting to master
Master_Host: 192.168.15.61
Master_User: replica
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000016
Read_Master_Log_Pos: 1054186012
Relay_Log_File: mysql-relay-bin.000431
Relay_Log_Pos: 39375086
Relay_Master_Log_File: mysql-bin.000016
Slave_IO_Running: Connecting
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 1547
Last_Error: Error 'Column count of mysql.proc is wrong. Expected 20, found 16. The table is probably corrupted' on query. Default database: 'ResumeDB'. Query: 'INSERT INTO `search` (zip_code,lat,lon,dist)
SELECT zipcode,latitude,longitude,GetDistance( NAME_CONST('lat1',32.84), NAME_CONST('long1',-83.68),B.latitude,B.longitude) as dist
FROM zipcodes AS B
WHERE
B.latitude BETWEEN NAME_CONST('lat1',32.84)-( NAME_CONST('range',25)* NAME_CONST('rangeFactor',0.014457)) AND NAME_CONST('lat1',32.84)+( NAME_CONST('range',25)* NAME_CONST('rangeFactor',0.014457))
AND B.longitude BETWEEN NAME_CONST('long1',-83.68)-( NAME_CONST('range',25)* NAME_CONST('rangeFactor',0.014457)) AND NAME_CONST('long1',-83.68)+( NAME_CONST('range',25)* NAME_CONST('rangeFactor',0.014457))
AND GetDistance( NAME_CONST('lat1',32.84), NAME_CONST('long1',-83.68),B.latitude,B.longitude) <= NAME_CONST('range',25) ORDER BY dist'
Skip_Counter: 1
Exec_Master_Log_Pos: 1053930692
Relay_Log_Space: 39635387
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 1547
Last_SQL_Error: Error 'Column count of mysql.proc is wrong. Expected 20, found 16. The table is probably corrupted' on query. Default database: 'ResumeDB'. Query: 'INSERT INTO `search` (zip_code,lat,lon,dist)
SELECT zipcode,latitude,longitude,GetDistance( NAME_CONST('lat1',32.84), NAME_CONST('long1',-83.68),B.latitude,B.longitude) as dist
FROM zipcodes AS B
WHERE
B.latitude BETWEEN NAME_CONST('lat1',32.84)-( NAME_CONST('range',25)* NAME_CONST('rangeFactor',0.014457)) AND NAME_CONST('lat1',32.84)+( NAME_CONST('range',25)* NAME_CONST('rangeFactor',0.014457))
AND B.longitude BETWEEN NAME_CONST('long1',-83.68)-( NAME_CONST('range',25)* NAME_CONST('rangeFactor',0.014457)) AND NAME_CONST('long1',-83.68)+( NAME_CONST('range',25)* NAME_CONST('rangeFactor',0.014457))
AND GetDistance( NAME_CONST('lat1',32.84), NAME_CONST('long1',-83.68),B.latitude,B.longitude) <= NAME_CONST('range',25) ORDER BY dist'
Replicate_Ignore_Server_Ids:
Master_Server_Id: 40
1 row in set (0.00 sec)
This is fixed with a
mysql > slave stop; SET GLOBAL sql_slave_skip_counter = 1; slave start;
and replication picks up again. Obviously not a full replica of data when doing this more than a few times.
No correct solution