Fix race condition in rdkafka statistics#6206
Merged
cirego merged 4 commits intoMaterializeInc:mainfrom Mar 25, 2021
cirego:chris/kafka-statistics-race
Merged
Fix race condition in rdkafka statistics#6206cirego merged 4 commits intoMaterializeInc:mainfrom cirego:chris/kafka-statistics-race
cirego merged 4 commits intoMaterializeInc:mainfrom
cirego:chris/kafka-statistics-race
Conversation
If metrics for a topic or partition are missing, don't abort. Continue processing the rest of the metrics instead. Eventually the metrics should show up. Add a test case to verify that the metrics are synchronized eventually. Fixes #6204
benesch
approved these changes
Mar 25, 2021
philip-stoev
pushed a commit
to philip-stoev/materialize
that referenced
this pull request
Apr 6, 2021
If metrics for a topic or partition are missing, don't abort. Continue processing the rest of the metrics instead. Eventually the metrics should show up. Add a test case to verify that the metrics are synchronized eventually. Fixes #6204
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.
There appears to be a race where a partition consumer can be aware of a partition before rdkafka decides to populate the statistics data structure for that partition.
We had two unchecked gets from the statistics data structure. Convert both of those gets to checked versions, where we simply ignore statistics for that topic / partition if it's missing. Add a test case to verify that the metrics are populated eventually.
First noticed when this started failing in CI for #6192.
This change is