Closed rink1969 closed 6 months ago
原因分析: 该节点为新创建的节点,从头同步区块的时间非常快,每个高度同步并执行之后都会给共识发送config消息。导致通道内堆积了100多个config消息。 但是consensus_raft是按3s的间隔去处理config消息,且每次只处理一个,所以要等300多秒之后才发现自己已经是共识节点了,然后才开始参与共识。
解决方案: consensus_raft是按3s的间隔去处理config消息,但是一次就把所有堆积的消息都处理掉。
这个只是问题的一种情况,即一开始节点不是共识节点,后来变成共识节点。
还有一种情况是节点一开始是共识节点,后来剔除出共识节点了。 如果节点数据丢失从头开始同步,那么一开始就会以为自己是共识节点,进而发起投票。 哪怕区块更新到最新,它已经不是共识节点了,但是它自己并不知道,因为其他raft节点不会再跟它通信了,所以它还是会一直尝试发起投票,会对其他共识节点有影响。
controller log
在163高度将新节点加入共识节点列表,新节点同步到了163并顺利执行 但是节点确迟迟没有参与共识
consensus_raft log