raft: move good case of truncateAndAppend to the first place