Repository navigation
feat(influxdb): alert when a shard fails to open (#1685) - #1691
Merged
Merged
Conversation
- shard-check.sh runs in the influxdb container: after /health answers and every 15 min it writes influxdb_health failed_shards=<n>i, the shards in the meta store and on disk that are not open - Grafana rule influxdb-shard-open-failed pages on failed_shards > 0 and when the check stops reporting for 1 h - test-shard-check.sh: healthy instance reports 0, a shard broken with the fields.idxl bug from #1370 reports 1 - docs: influxdb_health measurement and the alert in 'Field Types and Broken Shards'
- recheck shards that look failed once after 10 s, so a shard created by a write between the queries is not counted - alert also fires when influxdb cannot be queried for 15 min (execErrState Alerting, for 15m); a deploy restart does not page - test waits for the 'Failed to open shard' log line instead of the docker health status, which can be stale right after a start; it also removes its image
Owner
Author
Review and extra testsGrafana rule, tested in a local Grafana 9.5.21 + InfluxDB 1.12.4 (rule interval set to 10s for speed only):
Subagent review: no blockers. Fixed in the second commit:
Not changed: on the very first start of an empty volume, the first value comes 15 min late (the init server answers |
Closed
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #1685.
What
docker/influxdb/shard-check.sh: a small loop inside the influxdb container, started bysecure-entrypoint.sh./healthanswers. influxd opens all shards before it starts HTTP, so it never runs during the ~2 min shard loading.SHOW SHARDS(meta store) and have a directory on disk, but are missing fromSHOW STATS FOR 'shard'(only open shards are listed). All databases are checked.influxdb_health failed_shards=<n>ito thehomydatabase and logs the broken shards asshard-check: ....INFLUX_USERNAME/INFLUX_PASSWORD, so the password is not in the process list).influxdb-shard-open-failed("InfluxDB Shard Failed To Open"):last(failed_shards)over 1 h.noDataState: Alerting), so it also fires if the check stops.execErrState: OK, so an influxdb restart (query errors) does not page.docker/influxdb/test-shard-check.sh: the test from the issue.docs/influxdb-schema.md: theinfluxdb_healthmeasurement, and the alert named in "Field Types and Broken Shards" next to the repair steps.Tests
docker/influxdb/test-shard-check.sh(throwaway 1.12.4 container built from this image, auth on):validate-grafana-alerts: the new file passes (1 evaluator).Not done (on purpose, to keep it small)