Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StateMachine apply dataBuffer is empty #1179

Open
levil3 opened this issue Feb 11, 2025 · 3 comments
Open

StateMachine apply dataBuffer is empty #1179

levil3 opened this issue Feb 11, 2025 · 3 comments

Comments

@levil3
Copy link

levil3 commented Feb 11, 2025

Your question

当我在项目中使用JRaft时,StateMachine有时候会出现DataBuffer[pos、cap、limit都 = 0]的情况,并且我提交到JRaft的日志,会出现某几个节点能收到正确的DataBuffer,但是有个节点会收到异常的DataBuffer,请问这可能是什么原因导致的?
我试过调整了RaftOption的大小,如下面这种,但是没有什么作用
RaftOptions raftOptions = new RaftOptions();
raftOptions.setMaxByteCountPerRpc(128 * 1024 * 1024);

Your scenes

基于JRaft管理元数据,写入的数据量会较大。

Environment

  • SOFAJRaft version: latest
  • JVM version (e.g. java -version): JDK 17
  • OS version (e.g. uname -a): Centos 7
@fengjiachun
Copy link
Contributor

不可能的

StateMachine 实现对于 Data 的使用可参考一下这段代码

leader 节点在内存里,follower 节点需要反序列化

@levil3
Copy link
Author

levil3 commented Feb 12, 2025

不可能的

StateMachine 实现对于 Data 的使用可参考一下这段代码

leader 节点在内存里,follower 节点需要反序列化

你的意思是leader不能通过反序列化的方式获得数据吗?因为在我的StateMachine里不管是leader还是follower都是通过反序列化来获得数据

@killme2008
Copy link
Contributor

@fengjiachun 的意思是大概率是你的实现问题,检查或者单测下自己的代码吧,序列化和状态机处理这块,再不行可以去 debug 看看。

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

No branches or pull requests

3 participants