[MDEV-12038] Replication is stuck on a wrongly formated Binlog Created: 2017-02-09 Updated: 2019-08-21 Resolved: 2017-03-24 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Affects Version/s: | 10.1.18 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Patrick Moiroux | Assignee: | Unassigned |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | need_feedback, replication | ||
| Environment: |
Centos7 - MariaDB 10.1.18 |
||
| Issue Links: |
|
||||||||
| Description |
|
Sql thread is running on the slave but seems to be blocked on a specific position. when looking at that position on the master , the format seems to be broken (overlap between #at and end_log_pos lines:
On the master:
=> Everything seems to be in the file, but not in the correct order. Slave is not complaining but does nothing
|
| Comments |
| Comment by Elena Stepanova [ 2017-02-13 ] |
|
Sorry, could you please elaborate on "overlap between #at and end_log_pos lines"? I don't see what you mean at the first glance, maybe I'm missing something obvious. In fact, I don't see any problem at all from the paste in the description. |
| Comment by Patrick Moiroux [ 2017-02-16 ] |
|
Hi Elena, Thank you for your reply. I checked the code of our developer and reproduced the scenario, and this is the current status: Seconds_Behind_Master: 48170 This is what is done on the master: drop table if exists pmig_contracts_contractperiod; create table pmig_contracts_contractperiod as select id, reference_recurring_charge, reference_recurring_charge_monthly, period from contracts_contractperiod; – backup the original table update pmig_contracts_contractperiod set reference_recurring_charge_monthly = FLOOR(reference_recurring_charge/period*100)/100; CREATE INDEX pmig_contracts_contractperiod_idx ON pmig_contracts_contractperiod (id); And on the slave indeed it will be 921954 individual updates like this before creating the index:
Maybe it will be enough to create the INDEX before the update ? Any other suggestion? Thanks again for your time. |
| Comment by Elena Stepanova [ 2017-02-24 ] |
|
I didn't see the structure of the table, but in any case – whenever you use binlog_format=row|mixed, it's crucially important to have a PK/unique index on every table of a considerable size which receives updates, otherwise you will have horrible performance problems. In unfortunate circumstances it can indeed be many hours per update. So yes, please try to add the PK or unique index and check if it helps. |
| Comment by Elena Stepanova [ 2017-03-24 ] |
|
If you have further information on this issue, please comment and the report will be re-opened if needed. |