saveLeaderForTerm_replacesBothHalvesTogether
The record is one value, not two independent keys. Overwriting it must replace both halves together: an adapter that writes the term and the identity to separate rows can leave the new term beside the old identity, which is precisely the mismatched pin RaftStorage.saveLeaderForTerm's single-write requirement exists to prevent — and the engine has no way to detect it, since a pin at the current term is exactly what it is looking for.
Written with both halves changing at once so a per-field write survives neither.