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

Limit random MySQL server-id to 2^31-1 #2280

Closed
enisoc opened this issue Nov 21, 2016 · 0 comments · Fixed by #2291
Closed

Limit random MySQL server-id to 2^31-1 #2280

enisoc opened this issue Nov 21, 2016 · 0 comments · Fixed by #2291
Assignees

Comments

@enisoc
Copy link
Member

enisoc commented Nov 21, 2016

FYI @rnavarro

Users have seen the semi-sync plugin crash on the master, as mentioned in #2279.

From the MySQL error log:

2016-11-10T01:59:24.126332Z 1188 [Note] Start binlog_dump to master_thread_id(1188) slave_server(2904761766), pos(, 4)
2016-11-10T01:59:24.126371Z 1188 [Note] Start semi-sync binlog_dump to slave (server_id: -1390205530), pos(, 4)
*** buffer overflow detected ***: /usr/sbin/mysqld terminated

I noticed that the semi-sync log line interprets the server_id as signed 32-bit, whereas the log line from core mysqld interprets it as unsigned (or perhaps signed 64-bit):

>>> struct.unpack('i', struct.pack('I', 2904761766))
(-1390205530,)

It could just be a printing error, but I wouldn't be surprised if this is actually causing the buffer overflow.

When choosing random server_ids, we had assumed we could go up to 2^32-1 because that's what the MySQL docs say. However it appears the semi-sync plugin does not agree, so we should be more conservative and limit ourselves to 2^31-1.

@alainjobart alainjobart assigned alainjobart and unassigned pivanof Nov 22, 2016
frouioui pushed a commit to planetscale/vitess that referenced this issue Mar 26, 2024
…sistConfig for now to unblock CI (vitessio#2280)

* cherry pick of 13186

* Properly fix conflicts

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

---------

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Co-authored-by: Rohit Nayak <rohit@planetscale.com>
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 a pull request may close this issue.

3 participants