Make MaxScale handle zero-length files to aid bootstrapping. #78
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 = 0triggers 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.