raft 的一个约束问题 If leaderCommit > commitIndex, set commitIndex = min(leaderCommit, index of last new entry)

在论文中,AppendEntries RPC的规则5,是这样的:
If leaderCommit > commitIndex, set commitIndex = min(leaderCommit, index of last new entry)
这里的index of last new entry,我不知道改怎么理解。
我看了网上很多人的实现,都是:
if args.LeaderCommit > rf.commitIndex {
rf.commitIndex = min(args.LeaderCommit, len(rf.log)-1)
}
但是6.824助教的学生指南里面写了这段话:
The min in the final step (#5) of AppendEntries is necessary, and it needs to be computed with the index of the last new entry. It is not sufficient to simply have the function that applies things from your log between lastApplied and commitIndex stop when it reaches the end of your log. This is because you may have entries in your log that differ from the leader’s log after the entries that the leader sent you (which all match the ones in your log). Because #3 dictates that you only truncate your log if you have conflicting entries, those won’t be removed, and if leaderCommit is beyond the entries the leader sent you, you may apply incorrect entries.
所以上面那个实现方式是正确的吗,follow有没有可能apply与leader不一致的log?