Yriuns

Results 7 comments of Yriuns

> @Edward-xk 请问,我在看braft的选主过程,好像并没有确保所有log已经应用到状态机,才有资格成为leader。貌似只是比较lastLogTerm和LastLogIndex来选主。 > > 代码里面应该是比较的LogId,想请教下,是怎么保证新leader在“上任”后,能确保之前的log已经应用到状态机了? > 根据我的理解,只是日志是最新的,就有资格成为leader,但是日志应用到状态机是异步过程,不能确保一定应用到状态机。 投完票之后只是`_state = LEADER`,然后会提交一条配置变更日志,`on_leader_start`要等这条日志`on_apply`的时候才会调

> 有几个问题: > > 首先,在 A 还是 leader 的情况下,第 3 步 prevVote 就会忽略,不会同意,所以选举也不可能发生。见 https://github.com/sofastack/sofa-jraft/blob/master/jraft-core/src/main/java/com/alipay/sofa/jraft/core/NodeImpl.java#L1685-L1689 > > ```java > if (this.leaderId != null && !this.leaderId.isEmpty() && isCurrentLeaderValid()) { > LOG.info( >...

> 看情况 braft 是这个 commit 改了这块逻辑 [baidu/braft@3cfb1f1](https://github.com/baidu/braft/commit/3cfb1f110682d30f75dc1c750033575b36ef7801) 是的,这个commit是为了修复N>3的raft group切主不成功的问题,没想到引入了正确性问题。。

I encounter the similar issue when I copy `curl` command with long headers. I wonder if it is possible to disable the `zsh-syntac-highlighting` for specific prefix (like `curl`)?

Thanks I lot. I think I will use the former one.

> > > @Edward-xk 请问,我在看braft的选主过程,好像并没有确保所有log已经应用到状态机,才有资格成为leader。貌似只是比较lastLogTerm和LastLogIndex来选主。 > > > 代码里面应该是比较的LogId,想请教下,是怎么保证新leader在“上任”后,能确保之前的log已经应用到状态机了? > > > 根据我的理解,只是日志是最新的,就有资格成为leader,但是日志应用到状态机是异步过程,不能确保一定应用到状态机。 > > > > > > 投完票之后只是`_state = LEADER`,然后会提交一条配置变更日志,`on_leader_start`要等这条日志`on_apply`的时候才会调 > > 请教下我在主动切换leader, 从state == LEADER, 到调用on_leader_start要等20多秒,可能是什么原因造成的 @Yriuns...

> Yes, this oracle is called a differential testing oracle. We at @nus-test are actually working with @mrigger on this oracle right now. Great job!