At the point where a candidate becomes elected and initializes its matchIndex, it may already have entries in its log. If so, it should set its own matchIndex to a non-zero value, otherwise it will never count itself in the quorum for those entries.
Well, arguably a bug: it decreases the fault-tolerance of the cluster by 1 for all terms where that leader is elected, i.e. progress won't be made if f-1 nodes fail
At the point where a candidate becomes elected and initializes its matchIndex, it may already have entries in its log. If so, it should set its own matchIndex to a non-zero value, otherwise it will never count itself in the quorum for those entries.