Description
In GrpcLogAppender when an append entry times out we remove the entry from the pendingRequests. This decreases the size of pendingRequests which affects the logic in GrpcLogAppender#shouldWait. Further we also consider heartbeats in shouldWait because heartbeats are tracked in pendingRequests. It should actually wait on the number of log entries which are appended to follower but have not yet been processed by it.
GrpcConfigKeys.Server.leaderOutstandingAppendsMax should also be a fraction of RaftServerConfigKeys.Log.queueSize. This brings flow control for leader's append entries to follower because then number of outstanding append entries in leader would be limited by maximum number of operations in raft log worker.