Skip to content

fix(canal): Preserve binlog filename received in the fake rotate event #428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 23, 2019

Conversation

mefcorvi
Copy link
Contributor

The name of a binlog file received in the fake rotate event must be preserved as it was discussed in #406.

The decision is based on comments in
https://github.com/mysql/mysql-server/blob/8e797a5d6eb3a87f16498edcb7261a75897babae/sql/rpl_binlog_sender.h#L235

... It contains the name of the binlog we are going to
    send to the slave.
    Faked rotate event is required in a few cases, so slave can know which
    binlog the following events are from.
  - The binlog file slave requested is Empty. E.g.
    "CHANGE MASTER TO MASTER_LOG_FILE='', MASTER_LOG_POS=4", etc.
  - The position slave requested is exactly the end of a binlog file.
  - Previous binlog file does not include a rotate event.
    It happens when server is shutdown and restarted.
  - The previous binary log was GTID-free (does not contain a
    Previous_gtids_log_event) and the slave is connecting using
    the GTID protocol.

Closes #406

@mefcorvi mefcorvi changed the title fix(canal): Preserve binlog filename received in the fake rotate event #406 fix(canal): Preserve binlog filename received in the fake rotate event Sep 13, 2019
@siddontang
Copy link
Collaborator

thanks @mefcorvi

can we add a test to cover this?

@mefcorvi
Copy link
Contributor Author

can we add a test to cover this?

I think I can cover the first case "The binlog file slave requested is Empty", but for other cases I need to be able to manage the mysql server from the tests, i.e. shut it down, restart, reconfigure. Can you advise the simplest way to do that?

@siddontang siddontang merged commit cb33eb8 into go-mysql-org:master Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Canal: Wrong binlog position after MariaDB is restarted
2 participants