Skip to content

Conversation

@cirego
Copy link
Contributor

@cirego cirego commented Mar 24, 2021

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 Reviewable

@cirego cirego self-assigned this Mar 24, 2021
cirego added 2 commits March 24, 2021 16:08
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
@cirego cirego changed the title Testing rdkafka statistics race condition Fix race condition in rdkafka statistics Mar 24, 2021
@cirego cirego requested review from elindsey and quodlibetor March 24, 2021 23:34
@cirego cirego marked this pull request as ready for review March 24, 2021 23:35
@cirego cirego merged commit 4d1b4ea into MaterializeInc:main Mar 25, 2021
@cirego cirego deleted the chris/kafka-statistics-race branch March 25, 2021 12:10
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
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