Bug #64325 | MySQL Replication not applying changes | ||
---|---|---|---|
Submitted: | 14 Feb 2012 18:07 | Modified: | 15 Feb 2012 12:05 |
Reporter: | Renan RdS | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S2 (Serious) |
Version: | 5.1.49 | OS: | Linux (CentOS 5.5) |
Assigned to: | CPU Architecture: | Any | |
Tags: | freeze, mixed, relay, replication, Stuck |
[14 Feb 2012 18:07]
Renan RdS
[14 Feb 2012 18:15]
Valeriy Kravchuk
Looks like table you are trying to replicate does not have primary key defined (see bug #53375) Please, check. Also check if disabling query cache entirely helps in any way.
[14 Feb 2012 18:16]
Renan RdS
Changed from MySQL Replication stucked to MySQL Replication not applying changes
[14 Feb 2012 18:46]
Renan RdS
Hi Valeriy, The table does not have a PK because it has rows with the same value: mysql> select * from emailmkt.email_settings_cron_schedule limit 10; +-----------------+------------+ | jobtype | lastrun | +-----------------+------------+ | autoresponder | 0 | | bounce | 0 | | send | 1329132962 | | triggeremails_s | 0 | | triggeremails_p | 0 | | maintenance | 1329071946 | | splittest | 0 | | send | 1329132962 | | send | 1329132962 | | send | 1329132962 | +-----------------+------------+ 10 rows in set (0.00 sec) I've created indexes on both columns but the problem persists: mysql> show create table emailmkt.email_settings_cron_schedule\G *************************** 1. row *************************** Table: email_settings_cron_schedule Create Table: CREATE TABLE `email_settings_cron_schedule` ( `jobtype` varchar(20) DEFAULT NULL, `lastrun` int(11) DEFAULT '0', KEY `idx_teste1` (`jobtype`), KEY `idx_teste2` (`lastrun`), KEY `idx_teste3` (`jobtype`,`lastrun`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 1 row in set (0.01 sec) About the query cache, I tried before setting query_cache_size=0, but the problem persisted.
[14 Feb 2012 20:28]
Renan RdS
By the way, binlog_format=MIXED. I'm not sure if this bug applies to it. Wouldn't MySQL use 'statement' instead of 'row' based replication for tables without PK?
[15 Feb 2012 5:09]
Valeriy Kravchuk
So, this is a duplicate of bug #53375. There is no real solution in frames of 5.1 or 5.5 (work in progress for future versions), other than add primary key or force statement based replication. Read http://dev.mysql.com/doc/refman/5.1/en/binary-log-mixed.html about the details of when MIXED means ROW actually. It depends on many things, like transaction isolation level for InnoDB, but it does not depend on presence of PK (unfortunately). Your even from the binary log is ROW...
[15 Feb 2012 12:05]
Renan RdS
Thanks a lot! I've changed binlog_format to STATEMENT. Is there a way to manually apply binlogs generated with ROW_BASED converting to STATEMENT_BASED? Because I want to apply the old binlogs instead of recreating the standby server. I tried "mysqlbinlog --verbose", but it only generates commented information that is not SQL standard. ### UPDATE emailmkt.email_settings_cron_schedule ### WHERE ### @1='send' ### @2=1329132962 ### SET ### @1='send' ### @2=1329133022