apache-kafka - 是什么导致“分区没有提交的偏移量”,然后是 IllegalStateException
问题描述
我最近升级了 Kafka Streams 2.4.1 应用程序,由于以下错误,我们开始看到应用程序定期崩溃:
2020-05-13T11:27:08.553Z INFO <> [chat-98346af0-1be5-41e9-b15f-3cba364efa35-StreamThread-2] o.a.k.c.c.i.ConsumerCoordinator - [Consumer clientId=chat-98346af0-1be5-41e9-b15f-3cba364efa35-StreamThread-2-consumer, groupId=chat] Found no committed offset for partition private.chat.endpoint-1
2020-05-13T11:27:08.554Z ERROR <> [chat-98346af0-1be5-41e9-b15f-3cba364efa35-StreamThread-2] o.a.k.s.p.internals.StreamThread - stream-thread [chat-98346af0-1be5-41e9-b15f-3cba364efa35-StreamThread-2] Encountered the following error during processing:
java.lang.IllegalStateException: Offset limit should monotonically increase, but was reduced. New limit: 0. Previous limit: 1641
at org.apache.kafka.streams.processor.internals.StandbyTask.updateOffsetLimits(StandbyTask.java:215)
at org.apache.kafka.streams.processor.internals.StandbyTask.update(StandbyTask.java:181)
at org.apache.kafka.streams.processor.internals.StreamThread.maybeUpdateStandbyTasks(StreamThread.java:1009)
at org.apache.kafka.streams.processor.internals.StreamThread.runOnce(StreamThread.java:825)
at org.apache.kafka.streams.processor.internals.StreamThread.runLoop(StreamThread.java:698)
at org.apache.kafka.streams.processor.internals.StreamThread.run(StreamThread.java:671)
什么会导致“找不到分区的已提交偏移量”?
其他需要注意的事项:
- 我们将 TOPOLOGY_OPTIMIZATION 设置为 OPTIMIZE
- 我们只在三个环境中的两个环境中看到这一点(目前)
- 有一些证据表明这个错误的发生时间是有规律的。尽管并非总是如此,但错误之间的间隔为 24 小时是很常见的。
解决方案
推荐阅读
- php - 有图像 url 的 json 有问题
- javascript - 为什么在 JS 中调用异步函数不会阻塞?
- javascript - 删除用户选择标签后的字段要求
- c# - 可以在主 UI 线程之外的线程上更改 ObservableCollection 吗?
- reactjs - 具有基本名称的反应路由器也匹配没有基本路径的路由
- ruby-on-rails - Carrierwave、MiniMagick 和调整图像大小
- webrtc - PeerJS 不能与转向服务器一起使用
- html - 使用代码 <> 作为实际文本
- c++ - 使用递归时出现总线错误
- python - tensorflow 教程代码因 AttributeError 失败:“Tensor”对象没有属性“numpy”