本文介绍了为什么在重新启动时不会填写具有内存中键值存储的 GlobalKTable?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚 GlobalKTable 是如何工作的,并注意到我的内存键值存储在重新启动时没有填充.然而,文档听起来它是在重新启动的情况下填充的,因为整个数据在客户端上是重复的.

I am trying to figure out how GlobalKTable is working and noticed that my in memory key value store is not filled in case a restart. However the documentation sounds that it is filled in case a restart since the whole data is duplicated on clients.

当我调试我的应用程序时,看到 /tmp/kafka-streams/category-client-1/global/.checkpoint 上有一个文件,它包含一个关于我的主题的偏移量.这对于保留其数据并改进重新启动的存储可能是必要的,但是由于此文件中有偏移量,我的应用程序跳过恢复其状态.

When I debug my application see that there is a file on /tmp/kafka-streams/category-client-1/global/.checkpoint and it is including an offset about my topic. This might be maybe necessary for stores which are persisting their data and improve restarts however since there is an offset in this file, my application skips restoring its state.

我如何确保每次重新启动或重新启动都包含我的主题的全部数据?

How can I be sure that each restart or fresh start includes whole data of my topic?

推荐答案

因为您使用的是内存存储,所以我假设您遇到了这个错误:https://issues.apache.org/jira/browse/KAFKA-6711

Because you are using in-memory store I assume that you are hitting this bug: https://issues.apache.org/jira/browse/KAFKA-6711

作为一种解决方法,您可以删除全局存储的本地检查点文件——这将在重新启动时触发引导.或者您切换回默认的 RocksDB 存储.

As a workaround, you can delete the local checkpoint file for the global store -- this will trigger the bootstrapping on restart. Or you switch back to default RocksDB store.

这篇关于为什么在重新启动时不会填写具有内存中键值存储的 GlobalKTable?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-15 10:51