The partition is not a leader问题

  • nebula 版本:2.0rc1
  • 部署方式(分布式 / 单机 / Docker / DBaaS):docker swarm X5
  • 硬件信息
    • 磁盘( 推荐使用 SSD)nvme ssd
    • CPU、内存信息 96c 256g

我使用spark exchange导入数据,同样一批数据有的时候会疯狂的报这个错误,有的时候不报这个错误
我可以调节什么参数来解决这个问题?

我大概有点猜到原因,我做了一下测试。
我把batchsize改成1,然后插入有部分失败,但是大部分成功。
然后batchsize改成256,全部插入成功。
只有按这个逻辑执行才会插入成功,如果我一直不改成1,也会一直失败。
是不是因为batch插入不会更新graph的part leader信息?

storage日志

E0315 15:12:25.352514    38 Part.cpp:444] [Port: 9780, Space: 1, Part: 39] RaftPart buffer is full
E0315 15:12:25.398203    18 Part.cpp:444] [Port: 9780, Space: 1, Part: 23] RaftPart buffer is full
E0315 19:28:31.059305    41 RaftPart.cpp:367] [Port: 9780, Space: 1, Part: 10] The partition is not a leader
E0315 19:28:31.080816    14 RaftPart.cpp:687] [Port: 9780, Space: 1, Part: 29] Cannot append logs, clean the buffer
E0315 19:28:31.087797    37 RaftPart.cpp:367] [Port: 9780, Space: 1, Part: 95] The partition is not a leader
E0315 19:28:31.110427    37 RaftPart.cpp:687] [Port: 9780, Space: 1, Part: 70] Cannot append logs, clean the buffer
E0315 19:28:31.114656    14 RaftPart.cpp:367] [Port: 9780, Space: 1, Part: 69] The partition is not a leader
E0315 19:28:31.128865    23 RaftPart.cpp:687] [Port: 9780, Space: 1, Part: 9] Cannot append logs, clean the buffer
E0315 19:28:31.130453    23 RaftPart.cpp:367] [Port: 9780, Space: 1, Part: 90] The partition is not a leader
E0315 19:28:31.155683    23 RaftPart.cpp:687] [Port: 9780, Space: 1, Part: 29] Cannot append logs, clean the buffer
E0315 19:28:31.219853    37 RaftPart.cpp:367] [Port: 9780, Space: 1, Part: 73] The partition is not a leader

graph日志

ERROR writer.NebulaGraphClientWriter: write edge failed for Request to storage failed, without failedCodes.

嗯嗯,这个问题是因为第一次访问storage的时候是不知道leader是那台机器的,因此第一次访问总是会失败(错误的leader).

我的意思是,这并不是第一次访问的问题,
batch>1的时候一直都不会刷新leader信息,插入数据基本一直失败,
只有batch=1的时候才会刷新leader信息,开始几条失败,后面都是成功的。

因为batch 设置比较大 所以发送请求量相对来说少一些 graph 处理的QPS降低了