Skip to content
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

Make MaxScale handle zero-length files to aid bootstrapping. #78

Merged
merged 1 commit into from Apr 24, 2015
Merged

Conversation

sjmudd
Copy link
Contributor

@sjmudd sjmudd commented Apr 23, 2015

When bootstrapping a binlog router to start it needs to know the first
file to use. You can provide this information in the config file but
that will never be up to date, or you can copy a file to the binlog
server and start MaxScale. It will then carry on from the last file’s
current position.

What's better is to get the binlog server to pull the required data down
for you.

The binlog files have a 4-byte magic prefix so to start from the beginning
(position 4) you need to add these to an empty file if you do this by
hand. If you don’t then MaxScale will attempt to download from the
master at position 0 and the master will not accept this value. (This is
not apparent with a mysql client as CHANGE MASTER TO ... MASTER_LOG_POS = 0
triggers a write of the 4 magic bytes and then asks the master for
information from position 4 [not 0]).

This patch makes MaxScale behave similarly and allows you to only
need to touch the first binlog file to be downloaded for it to do the
right thing.

When bootstrapping a binlog router to start it needs to know the first
file to use. You can provide this information in the config file but
that will never be up to date, or you can copy a file to the binlog
server and start maxscale. It will then carry on from the last file’s
current position.

The binlog files have a 4-byte magic prefix so to start from the beginning
(position 4) you need to add these to an empty file if you do this by
hand. If you don’t then maxscale will attempt to download from the
master at position 0 and the master will not accept this value. (This is
not apparent with a mysql client as change master to … master_log_pos
= 0 triggers a write of the 4 magic bytes and then asks the master for
information from position 4 [not 0]).

This patch makes MaxScale behave similarly and allows you to only
need to touch the first binlog file to be downloaded for it to do the
right thing.
@sjmudd
Copy link
Contributor Author

sjmudd commented Apr 23, 2015

markus456 added a commit that referenced this pull request Apr 24, 2015
Make MaxScale handle zero-length files to aid bootstrapping.
@markus456 markus456 merged commit e7cdf4d into mariadb-corporation:develop Apr 24, 2015
liangg added a commit to airbnb/MaxScale that referenced this pull request Oct 13, 2016
…config_reload_fix

[DBProxy] Must acquire server persist pool lock for conn pool size reload
@sjmudd
Copy link
Contributor Author

sjmudd commented Aug 1, 2018

This is to confirm that this patch is provided under the BSD-new license.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants