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

Fix detection of slave running for all mysql versions #89

Merged
merged 4 commits into from
Jul 19, 2021

Conversation

carlossscastro
Copy link
Contributor

Fix detection of slave.running metric.

With this fix we retrieve the values of Slave_IO_Running and Slave_SQL_Running and if both are Yes slave.running is populated as 1 or 0 if any one of those 2 metrics is not Yes
The metric slave.running provided directly by mysql, using the logic above, was removed from version 5.7 and above.

@carlossscastro
Copy link
Contributor Author

There were other approaches to obtain the status of the slave but as the integration already performs a show slave status query, and the information can be obtained from there, we did not add any extra query to keep the impact of the integration to the minimum.
More context on this or other solutions:
https://blog.pythian.com/verify-slave-running-mysql-5-7/

@carlossscastro carlossscastro linked an issue Jul 2, 2021 that may be closed by this pull request
Copy link
Contributor

@roobre roobre left a comment

Choose a reason for hiding this comment

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

Looking nice overall! Left a couple questions and a few nitpicks.

src/metrics.go Outdated Show resolved Hide resolved
src/metrics.go Outdated Show resolved Hide resolved
tests/integration/MasterDockerfile Outdated Show resolved Hide resolved
tests/integration/SlaveDockerfile Outdated Show resolved Hide resolved
tests/integration/docker-compose.yml Show resolved Hide resolved
tests/integration/mysql-config-files/master.conf.cnf Outdated Show resolved Hide resolved
tests/integration/mysql-config-files/slave.conf.cnf Outdated Show resolved Hide resolved
Copy link
Contributor Author

@carlossscastro carlossscastro left a comment

Choose a reason for hiding this comment

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

Fixes submitted

src/metrics.go Outdated Show resolved Hide resolved
src/metrics.go Outdated Show resolved Hide resolved
tests/integration/MasterDockerfile Outdated Show resolved Hide resolved
tests/integration/SlaveDockerfile Outdated Show resolved Hide resolved
tests/integration/docker-compose.yml Show resolved Hide resolved
src/metrics.go Outdated Show resolved Hide resolved
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.

cluster.slaveRunning is missing on MySQL 5.7 and higher
2 participants