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

MODULES-3711 - Add limit to mysql server ID generated value #872

Merged
merged 1 commit into from
Aug 12, 2016

Conversation

QuentinMoss
Copy link
Contributor

@QuentinMoss QuentinMoss commented Aug 9, 2016

MySQL server ID requires a value that is less than 2^32. With the current server-id generation it's possible to get a value that exceeds this limit. Reference the following documentation:
https://dev.mysql.com/doc/refman/5.7/en/replication-options.html#option_mysqld_server-id
I have provided an example of the fix below:

irb(main):002:0> x = ['ff','ff','ff','ff','ff','ff'][2..-1].inject(0)
{ |total, value| (total << 6) + value.hex }
=> 67907775
irb(main):003:0> x < 2**32
=> true

See bug report here: https://tickets.puppetlabs.com/browse/MODULES-3711

@QuentinMoss QuentinMoss changed the title Add limit to mysql server ID generated value MODULES-3711 - Add limit to mysql server ID generated value Aug 10, 2016
@trevor-vaughan
Copy link

👍 However, should there be an additional test that explicitly checks to make sure that the integer is < 2**32?

@rnelson0
Copy link
Contributor

@trevor-vaughan I think that's mathematically impossible in the current state of our universe, though :)

@trevor-vaughan
Copy link

@rnelson0 So, you're saying that failure of that test would be a very bad thing?

@rnelson0
Copy link
Contributor

Yep, but you're testing math, not the puppet code, at that point.

Rob Nelson
rnelson0@gmail.com

iuriaranda added a commit to skyscrapers/puppetlabs-mysql that referenced this pull request Aug 12, 2016
@bmjen
Copy link
Contributor

bmjen commented Aug 12, 2016

Thanks for the patch @QuentinMoss ! As well as the feedback @trevor-vaughan and @rnelson0 . I agree with Rob here.

Thanks!

@bmjen bmjen merged commit d5d9d2a into puppetlabs:master Aug 12, 2016
@QuentinMoss QuentinMoss deleted the mysql-server-id branch August 12, 2016 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants