forked from apache/kafka
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Duplicate metrics should not lead to failure (#24)
* Duplicate metrics should not lead to failure There have been many bugs that have crept in over the years that lead to some sort of broker failure because sensors were not cleaned up properly during some normal state transition. KAFKA-8066 is a good example of this. Even after the fix in 6ca899e for that bug, we are still seeing the same problem in production. Rather than trying to find all possible code paths that can lead to Selector#close not being invoked, this patch just makes duplicate metrics log an error without throwing. While duplicate metrics from multiple sensors can be the sign of another bug, making it fatal seems like a mistake. A common failure we see is that a replica fetcher thread does not shut down cleanly, leaving behind some metrics as the thread dies (taking its NetworkClient with it). Later, when the broker tries to start a replacement replica fetcher thread in response to a LeaderAndIsr request from the controller, the fetcher thread cannot start due to this sensor conflict. Failing to start a replica fetcher in this case can lead to a data loss situation, since we could end up with the cluster in a state where we cannot safely restart any brokers to clear up this situation without offline partitions. Rather than continuing this trend, we should make sensor duplication non-fatal. This behavior is configurable and is disabled by default.
- Loading branch information
Showing
12 changed files
with
80 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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