Skip to content

Conversation

@tgross
Copy link
Contributor

@tgross tgross commented May 5, 2016

There is a race between the onChange and health handler around stopping replication while we figure out which instance is primary. These leaves the onChange handler in an infinite loop because we previously assumed that the only errors we'd get were from the session lock.

This PR breaks the loop when error code 1198 ER_SLAVE_MUST_STOP is received from mysqld, which says that replication has already been started.

cc @misterbisson for review

tgross added 2 commits May 5, 2016 14:07
There is a race between the onChange and health handler around stopping
replication while we figure out which instance is primary. These leaves
the onChange handler in an infinite loop because we previously assumed
that the only errors we'd get were from the session lock.

This commit breaks the loop when error code 1198 ER_SLAVE_MUST_STOP is
received from mysqld, which says that replication has already been started.
# ---------------------------------------------------------
# Top-level functions called by ContainerPilot or forked by this program

@debug
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intended to leave this in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah. At the top of the file you'll see I did a little expanding of the information in the debug log so that interleaved events can be separated. While doing that it became obvious we needed to tag a couple more events to see the workflow properly.

@misterbisson
Copy link
Contributor

lgtm.

@tgross tgross merged commit 88020b9 into autopilotpattern:master May 5, 2016
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.

2 participants